• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

How do I specify a folder?

 
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.
 
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.
 
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
Boost this thread!