相关疑难解决方法(0)

如何使用<a href="...">标签提交POST表单?

如何提交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)

html forms jsp

71
推荐指数
4
解决办法
26万
查看次数

调用j_spring_security_logout不起作用

我正在尝试使用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)

提前致谢.

security spring logout

20
推荐指数
3
解决办法
4万
查看次数

在JSP中单击href发送发布请求

如果我们写下如下内容:

<a href="MyServlet">Link</a>
Run Code Online (Sandbox Code Playgroud)

它将调用该servlet的GET方法.我可以点击a标签发送帖子请求吗?可能吗?

我知道如何使用Javascript进行此操作,但想知道是否可以在没有JavaScript的情况下完成此操作.

html jsp

11
推荐指数
1
解决办法
6万
查看次数

标签 统计

html ×2

jsp ×2

forms ×1

logout ×1

security ×1

spring ×1