aspose file tools*
The moose likes Struts and the fly likes How do I specify a folder? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How do I specify a folder?" Watch "How do I specify a folder?" New topic
Author

How do I specify a folder?

Rajkumar Katudia
Ranch Hand

Joined: Jul 28, 2009
Posts: 51
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

Joined: Jul 28, 2009
Posts: 51
The setup is working as expected just that I want to change the location of jsp file.
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

<package name="system-default" namespace="/jsps" extends="struts-default">


ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
Rajkumar Katudia
Ranch Hand

Joined: Jul 28, 2009
Posts: 51
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

Joined: Mar 31, 2011
Posts: 32

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

Joined: Jul 28, 2009
Posts: 51
Thanks it worked
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do I specify a folder?
 
Similar Threads
struts2: howto correctly deligate actions on the struts.xml's include files
Struts + Tomcat 6 + HelloWorld = Pain
Page not found
Little Bit of Information
Struts 2 jsp Error.