如何提交POST表单才能showMessage.jsp使用<a href="...">标签?
<form action="showMessage.jsp" method="post">
<a href="showMessage.jsp"><%=n%></a>
<input type="hidden" name="mess" value=<%=n%>/>
</form>
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用j_spring_security_logout设置我的应用程序的logut但由于某种原因它无法正常工作,我一直收到404错误.
我正在调用这样的函数:
<a href="<c:url value="/j_spring_security_logout"/>"><img border="0" id="logout" src="./img/logout.png" /></a>
我在WebContent/jsp/my应用程序主页面中,登录和注销页面在WebContent/login /中.
我还检查了Spring安全注销的其他帖子问题但是那里给出的解决方案对我不起作用.
在这里你可以看到我的web.xml
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>
org.springframework.web.filter.DelegatingFilterProxy
</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Run Code Online (Sandbox Code Playgroud)
这是我的spring-security.xml
<http auto-config="true">
<intercept-url pattern="/*" access="ROLE_USER" />
<form-login login-page="/login/login.jsp"
authentication-failure-url="/login/errorLogin.jsp"/>
<logout logout-success-url="/" logout-url="/login/logout.jsp" />
</http>
<beans:bean id="myAuthenticationProvider"
class="myapp.web.authentication.WSAuthenticationProvider">
</beans:bean>
<authentication-manager>
<authentication-provider ref="myAuthenticationProvider"/>
</authentication-manager>
Run Code Online (Sandbox Code Playgroud)
提前致谢.
如果我们写下如下内容:
<a href="MyServlet">Link</a>
Run Code Online (Sandbox Code Playgroud)
它将调用该servlet的GET方法.我可以点击a标签发送帖子请求吗?可能吗?
我知道如何使用Javascript进行此操作,但想知道是否可以在没有JavaScript的情况下完成此操作.