I'm really racking my head here with Struts2 - I'm able to access the JSP pages by omitting part of the path. Note the path suppose to include pages/welcome_user.jsp
. The key is to look at the word pages
in the path.
here's the struts.xml
file:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="default" namespace="/User" extends="struts-default">
<action name="Login">
<result>pages/login.jsp</result>
</action>
<action name="Welcome" class="com.mkyong.user.action.WelcomeUserAction">
<result name="SUCCESS">pages/welcome_user.jsp</result>
</action>
</package>
</struts>
I'm able to access login.jsp
via: http://localhost/Struts2Example/User/Login
and welcome_user.jsp
via: http://localhost/Struts2Example/User/Welcome
Note that in both URL, I'm able to drop pages
, why?
source: http://www.mkyong.com/misc/how-to-use-mkyong-tutorial/
Can someone go through the above tutorial and tell me what's wrong?