"The login.page path does not start with an error" / "character after changing the java version

I have a web application that works with the following: Tomcat 5.0 Struts 1.0 Java 1.5

I need to switch to Java 1.6. When I tried to do this, I got the following exception stack in my browser:

javax.servlet.ServletException: Path login.page does not start with a "/" character
    org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)
    org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
    org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:72)
    org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:712)
    org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:682)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:45)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:78)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)

The main reason

java.lang.IllegalArgumentException: Path login.page does not start with a "/" character
    org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:107)
    org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:96)
    org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
    org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
    org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
    org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
    org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
    org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
    org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
    org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:72)
    org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:712)
    org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:682)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:45)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:78)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
+3
source share
3 answers

It looks like the request is being made on "login.page", which, as the exception indicates, does not start with "/". Try to request instead "/login.page".

In most servlet libraries, path names begin with "/". For example: javax.servlet.ServletContext # getRequestDispatcher :

"/" . getContext RequestDispatcher .

+4

.

http://wiki.apache.org/struts/StrutsUpgradeNotes12to13

, . Struts 1.3, web.xml:

<init-param>
    <param-name>chainConfig</param-name>
    <param-value>org/apache/struts/tiles/chain-config.xml</param-value>
</init-param>
+2

add a fragment request processor class and remove an attribute of type conten from the controller tag

<controller processorClass="org.apache.struts.tiles.TilesRequestProcessor" />

<message-resources parameter="EMSMessageResources" null="false" ></message-resources>

<plug-in className="org.apache.struts.tiles.TilesPlugin" >
    <set-property property="definitions-config" value="/WEB-INF/ems-tiles-defs.xml" />
    <set-property property="moduleAware" value="true" />
</plug-in>
0
source

Source: https://habr.com/ru/post/1734560/


All Articles