Announcement Announcement Module
Collapse
No announcement yet.
Spring Security Authorize JSP tag nested inside Spring Form JSP Tag Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Security Authorize JSP tag nested inside Spring Form JSP Tag

    I want to hide spring form input tag on the basis of role using spring security authorize jsp tag.Please see below the code and error. And also form is bound to a model obviously , i believe it's not a correct way to use security tags nested inside spring form jsp tag. If possible , please provide better alternatives to resolve my issue.Thanks in advance.


    Error is :-
    Code:
    <form:form id="searchFlds" modelAttribute="model" action="search" method="POST" >
    <sec:authorize access="hasRole('ROLE_MANAGER')">
         <div id="search">
          <form:radiobutton id="search" name ="search" path="search" value="1"/>
         <label for="search">Search</label>
         </div>
          </sec:authorize>
    </form:form>
    Code:
    13:02:16,812 ERROR [ContainerBase] Servlet.service() for servlet registration threw exception
    org.apache.jasper.JasperException: /WEB-INF/jsp/search.jsp(88,0) The end tag "&lt;/form:form" is unbalanced
            at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
            at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
            at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:132)
            at org.apache.jasper.compiler.Parser.checkUnbalancedEndTag(Parser.java:1581)
            at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1450)
            at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1657)
            at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1004)
            at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1272)
            at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1449)
            at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1657)
            at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1004)
            at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1272)
            at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1449)
            at org.apache.jasper.compiler.Parser.parse(Parser.java:133)
            at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:216)
            at org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
            at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:153)
            at org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
            at org.apache.jasper.compiler.Compiler.compile(Compiler.java:294)
            at org.apache.jasper.compiler.Compiler.compile(Compiler.java:281)
            at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
            at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
            at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:687)
            at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469)
            at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)
            at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
            at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
            at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:262)
            at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1180)
     at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:950)
     at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
     at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
     at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at com.tesco.tamMonitor.common.TamFilter.doFilter(TamFilter.java:25)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:343)
     at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
     at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
     at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
     at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
     at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
     at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
     at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
     at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:177)
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
     at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
     at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
     at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
     at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:149)
     at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
     at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
     at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
     at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
     at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
     at java.lang.Thread.run(Thread.java:619)
    Last edited by baddie; Feb 27th, 2013, 02:27 AM. Reason: incomplete code
Working...
X