Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do I specify a folder?

 
Rajkumar Katudia
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is regarding struts 2.

I have my jsp "login.jsp" directly under context root of my web application.

I want to change the location of jsp to a folder jsps and specify the result to jsps/login.jsp.

How do I acheive this???

So, basically I want to be able to change the result tag of my action

from
<result name="input">login.jsp</result>
to
<result name="input">jsps/login.jsp</result>

If I try this, the server tells me no resource available.

Thanks in advance.

I have the following 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>
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.devMode" value="false" />
<package name="system-default" namespace="/" extends="struts-default">
<action name="LoginUser" class="bra.controller.LoginController">
<result name="input">login.jsp</result>
</action>
</package>
</struts>


 
Rajkumar Katudia
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The setup is working as expected just that I want to change the location of jsp file.
 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<package name="system-default" namespace="/jsps" extends="struts-default">
 
Rajkumar Katudia
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MoHaNa RaO wrote:<package name="system-default" namespace="/jsps" extends="struts-default">


No that did not work

I tried both namespace="/jsps"
and namespace="jsps"

This is trivial but not many people seem to know this.
 
Pankaj Kr. Singh
Ranch Hand
Posts: 32
Hibernate Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Put your login.jsp in the jsps folder and refer it from result tag as follows:-
<result name="input">jsps/login.jsp</result>

 
Rajkumar Katudia
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks it worked
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic