In meinem Projekt null wir spring4.When verwenden i die Post-Anforderung url gehtName der Aktion im Frühjahr 4 mvc
mit null einreichen<form:form name="authenticatorform" id="loginForm" action="login.htm">
<input type="submit">
</form:form>
Wenn ich versuche, das Formular zu senden, ist die URL wie folgt aussehen
localhost:8080/selva/null
instead of
localhost:8080/selva/login.htm
ich die Ansicht Seite Quelle habe zeigt es wie unten
<form:form name="authenticatorform" id="loginForm" action="null">
<input type="submit">
</form:form>
gibt es eine Konfigurationsproblem ich verpasst ou t. Jede Hilfe wird sehr geschätzt werden !!! Web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:web="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<init-param>
<param-name>throwExceptionIfNoHandlerFound</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/dispatcher-servlet.xml, /WEB-INF/spring-security.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
</web-app>
feder security.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.2.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-4.2.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-4.2.xsd">
<http auto-config="true" use-expressions="true">
<intercept-url pattern="/admin" access="hasRole('9')"
requires-channel="http" method="POST" />
<csrf disabled="false"/>
</http>
<authentication-manager>
<authentication-provider>
<user-service>
<user name="alex" password="123456789" authorities="ROLE_USER" />
<user name="mkyong" password="123456789" authorities="ROLE_USER, ROLE_ADMIN" />
</user-service>
</authentication-provider>
</authentication-manager>
</beans:beans>
Ist es das Konfigurationsproblem?
Ich glaube nicht, es ist ein guter Ansatz, um. HTM-Datei in Form Submit (Aktion) -Ereignis zu setzen, sollten Sie entweder Controller oder JSP von ihrem aufrufen. – Mayur
Wie rendern Sie diese Formularseite? – Blank
Verwenden von Kacheln org.springframework.web.servlet.view.UrlBasedViewResolver – Madhesh