0
我已經搜索了很多頁面並關注,看起來我不是幸運的人,我無法運行我的登錄頁面(我是新手)。當我點擊登錄按鈕時,什麼也沒有發生。這裏是我的web應用程序結構無法用Shiro運行登錄表格
login.xhtml(JSF形式)
<h:form prependId="false">
<h:panelGroup>
<h:panelGrid id="panel" columns="2" border="1" cellpadding="0" cellspacing="2">
<h:outputLabel for="username" value="Email" />
<h:inputText id="username" />
<h:outputLabel for="password" value="Password" />
<h:inputText id="password" />
</h:panelGrid>
<h:commandButton value="Login" style="margin-top: 10px;"/>
</h:panelGroup>
</h:form>
的web.xml
<filter>
<filter-name>Pretty Filter</filter-name>
<filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class>
</filter>
<filter>
<filter-name>ShiroFilter</filter-name>
<filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Pretty Filter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>ShiroFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
<!-- Setup Apache Shiro for Authentication & Authorization -->
<listener>
<listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
</listener>
shiro.ini
[main]
authc = com.beacon.security.MetroFormAuthenticationFilter
authc.loginUrl = /login.xhtml
authc.successUrl = /home
[urls]
/login.xhtml = authc
/errors/notAuthorized.xhtml = authc
/** = anon
有人可以找出我的錯誤! –