You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Navjot Singh <na...@net4india.net> on 2003/03/13 15:06:44 UTC
Need one mnore directory before module-prefix
Hi List,
I am just a newbie to this struts framework.
I am using struts 1.1 and using modules for my app. I have set my dir
structure like this.
/jsp/mod1
/jsp/mod2
/Web-inf/*
All my jsps are accessible using
http://localhost:8080/myapp/jsp/mod1/test.jsp
In struts-mod1.xml,
IF I have a tag <action path="/Test" forward="/test.jsp"/>
When i call thru browser http://localhost:8080/myapp/mod1/Test.do, it tried
to locate http://localhost:8080/myapp/mod1/test.jsp
IF I give tag <action path="/Test" forward="/jsp/mod1/test.jsp"/>, it
naturally tries to locate http://localhost:8080/myapp/mod1/jsp/mod1/test.jsp
BUT I want the url to be http://localhost:8080/myapp/jsp/mod1/test.jsp
Is it possible to achieve using Struts-Config (may be forwardPattern ?) or
even if web.xml can be of any help here?
Please help.
regards
Navjot Singh
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Need one mnore directory before module-prefix
Posted by Navjot Singh <na...@net4india.net>.
so, this is the only way to do it :-(
I thought I have just one static directory to prepend before my module
prefix to solve the problem. But it's not possible.
thanks for the help, bekrar. Bekrar, if you read my second mail with subject
"unable to find mapping", you will get an idea what i was trying to do but
now can't do.
-navjot
----- Original Message -----
From: "Noureddine Bekrar" <nb...@rennes.jouve.fr>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, March 13, 2003 8:09 PM
Subject: Re: Need one mnore directory before module-prefix
| you can do that
|
| <action path="/test" type="TestAction.java">
| <forward name="testforward" path="/jsp/mod1/test.jsp">
| </forward>
| </action>
|
| and at the end of the execute methode of your
| testaction class do this:
| mapping.findForward(testforward);
|
|
| ----- Original Message -----
| From: "Navjot Singh" <na...@net4india.net>
| To: "Struts Users Mailing List" <st...@jakarta.apache.org>
| Sent: Thursday, March 13, 2003 3:25 PM
| Subject: Re: Need one mnore directory before module-prefix
|
|
| > hi bekrar,
| >
| > That i can do but i don't want to do. I thought there could be some way
| out
| > with forwardPattern stuff.
| >
| > I am ready to leave <action path="/test" forward="abc"/> (for it doesnot
| > support forwardPattern)
| > and SHIFT to
| >
| > <action ............>
| > <forward ............/>
| > </action>
| >
| > kind of tag
| >
| > If this is not possible, can I write my own subclass ForwardAction and
do
| > the job.
| > Where can I pre-pend "/jsp" to whatever url i will get from struts
| (assuming
| > it will be context-relative).
| >
| > regards
| > Navjot Singh
| >
| > ----- Original Message -----
| > From: "Noureddine Bekrar" <nb...@rennes.jouve.fr>
| > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
| > Sent: Thursday, March 13, 2003 7:48 PM
| > Subject: Re: Need one mnore directory before module-prefix
| >
| >
| > | you can use <action path="/Test" />
| > |
| > | when you write this , it's suppose that tou have an action mapping
| called
| > | "test" in your struts-config file ( redirection to your test action
| class)
| > | you can directley call the right forward in your test class with the
| > | mapping.findForward(testforward);
| > | the test forward is a forward that you declare in the struts config
| (it's
| > a
| > | redirection to your jsp)
| > | you can declare it like this:
| > | /jsp/mod1/test.jsp
| > |
| > |
| > |
| > |
| > |
| > |
| > |
| > |
| > | ---------------------------------------------------------------------
| > | To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
| > | For additional commands, e-mail: struts-user-help@jakarta.apache.org
| > |
| > |
| >
| >
| > ---------------------------------------------------------------------
| > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
| > For additional commands, e-mail: struts-user-help@jakarta.apache.org
| >
| >
|
|
| ---------------------------------------------------------------------
| To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
| For additional commands, e-mail: struts-user-help@jakarta.apache.org
|
|
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Need one mnore directory before module-prefix
Posted by Navjot Singh <na...@net4india.net>.
hi list,
I guess i have started learning as i have solved my first big problem.
I was adamant on putting all my modules in one DIR i.e inside "jsp". That
was invalidating the strutus module-prefix role that forces me to put all
module inside ROOT only.
Given the direction suggested by Eddie(you *got* to go ythru controller ;-)
, i tried to do alternate way and got success with
<action path="/AddContact"
type="org.apache.struts.actions.ForwardAction"
parameter="/jsp/mod1/addCont_b.jsp"/>
in my struts-mod1.xml
pretty simple it was. Wonder why did i spent too much time :-)
thanks to berker,eddie and everybody out there.
-navjot
----- Original Message -----
From: "Noureddine Bekrar" <nb...@rennes.jouve.fr>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, March 13, 2003 8:09 PM
Subject: Re: Need one mnore directory before module-prefix
| you can do that
|
| <action path="/test" type="TestAction.java">
| <forward name="testforward" path="/jsp/mod1/test.jsp">
| </forward>
| </action>
|
| and at the end of the execute methode of your
| testaction class do this:
| mapping.findForward(testforward);
|
|
| ----- Original Message -----
| From: "Navjot Singh" <na...@net4india.net>
| To: "Struts Users Mailing List" <st...@jakarta.apache.org>
| Sent: Thursday, March 13, 2003 3:25 PM
| Subject: Re: Need one mnore directory before module-prefix
|
|
| > hi bekrar,
| >
| > That i can do but i don't want to do. I thought there could be some way
| out
| > with forwardPattern stuff.
| >
| > I am ready to leave <action path="/test" forward="abc"/> (for it doesnot
| > support forwardPattern)
| > and SHIFT to
| >
| > <action ............>
| > <forward ............/>
| > </action>
| >
| > kind of tag
| >
| > If this is not possible, can I write my own subclass ForwardAction and
do
| > the job.
| > Where can I pre-pend "/jsp" to whatever url i will get from struts
| (assuming
| > it will be context-relative).
| >
| > regards
| > Navjot Singh
| >
| > ----- Original Message -----
| > From: "Noureddine Bekrar" <nb...@rennes.jouve.fr>
| > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
| > Sent: Thursday, March 13, 2003 7:48 PM
| > Subject: Re: Need one mnore directory before module-prefix
| >
| >
| > | you can use <action path="/Test" />
| > |
| > | when you write this , it's suppose that tou have an action mapping
| called
| > | "test" in your struts-config file ( redirection to your test action
| class)
| > | you can directley call the right forward in your test class with the
| > | mapping.findForward(testforward);
| > | the test forward is a forward that you declare in the struts config
| (it's
| > a
| > | redirection to your jsp)
| > | you can declare it like this:
| > | /jsp/mod1/test.jsp
| > |
| > |
| > |
| > |
| > |
| > |
| > |
| > |
| > | ---------------------------------------------------------------------
| > | To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
| > | For additional commands, e-mail: struts-user-help@jakarta.apache.org
| > |
| > |
| >
| >
| > ---------------------------------------------------------------------
| > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
| > For additional commands, e-mail: struts-user-help@jakarta.apache.org
| >
| >
|
|
| ---------------------------------------------------------------------
| To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
| For additional commands, e-mail: struts-user-help@jakarta.apache.org
|
|
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Need one mnore directory before module-prefix
Posted by Noureddine Bekrar <nb...@rennes.jouve.fr>.
you can do that
<action path="/test" type="TestAction.java">
<forward name="testforward" path="/jsp/mod1/test.jsp">
</forward>
</action>
and at the end of the execute methode of your
testaction class do this:
mapping.findForward(testforward);
----- Original Message -----
From: "Navjot Singh" <na...@net4india.net>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, March 13, 2003 3:25 PM
Subject: Re: Need one mnore directory before module-prefix
> hi bekrar,
>
> That i can do but i don't want to do. I thought there could be some way
out
> with forwardPattern stuff.
>
> I am ready to leave <action path="/test" forward="abc"/> (for it doesnot
> support forwardPattern)
> and SHIFT to
>
> <action ............>
> <forward ............/>
> </action>
>
> kind of tag
>
> If this is not possible, can I write my own subclass ForwardAction and do
> the job.
> Where can I pre-pend "/jsp" to whatever url i will get from struts
(assuming
> it will be context-relative).
>
> regards
> Navjot Singh
>
> ----- Original Message -----
> From: "Noureddine Bekrar" <nb...@rennes.jouve.fr>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Thursday, March 13, 2003 7:48 PM
> Subject: Re: Need one mnore directory before module-prefix
>
>
> | you can use <action path="/Test" />
> |
> | when you write this , it's suppose that tou have an action mapping
called
> | "test" in your struts-config file ( redirection to your test action
class)
> | you can directley call the right forward in your test class with the
> | mapping.findForward(testforward);
> | the test forward is a forward that you declare in the struts config
(it's
> a
> | redirection to your jsp)
> | you can declare it like this:
> | /jsp/mod1/test.jsp
> |
> |
> |
> |
> |
> |
> |
> |
> | ---------------------------------------------------------------------
> | To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> | For additional commands, e-mail: struts-user-help@jakarta.apache.org
> |
> |
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Need one mnore directory before module-prefix
Posted by Navjot Singh <na...@net4india.net>.
hi bekrar,
That i can do but i don't want to do. I thought there could be some way out
with forwardPattern stuff.
I am ready to leave <action path="/test" forward="abc"/> (for it doesnot
support forwardPattern)
and SHIFT to
<action ............>
<forward ............/>
</action>
kind of tag
If this is not possible, can I write my own subclass ForwardAction and do
the job.
Where can I pre-pend "/jsp" to whatever url i will get from struts (assuming
it will be context-relative).
regards
Navjot Singh
----- Original Message -----
From: "Noureddine Bekrar" <nb...@rennes.jouve.fr>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, March 13, 2003 7:48 PM
Subject: Re: Need one mnore directory before module-prefix
| you can use <action path="/Test" />
|
| when you write this , it's suppose that tou have an action mapping called
| "test" in your struts-config file ( redirection to your test action class)
| you can directley call the right forward in your test class with the
| mapping.findForward(testforward);
| the test forward is a forward that you declare in the struts config (it's
a
| redirection to your jsp)
| you can declare it like this:
| /jsp/mod1/test.jsp
|
|
|
|
|
|
|
|
| ---------------------------------------------------------------------
| To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
| For additional commands, e-mail: struts-user-help@jakarta.apache.org
|
|
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Need one mnore directory before module-prefix
Posted by Noureddine Bekrar <nb...@rennes.jouve.fr>.
you can use <action path="/Test" />
when you write this , it's suppose that tou have an action mapping called
"test" in your struts-config file ( redirection to your test action class)
you can directley call the right forward in your test class with the
mapping.findForward(testforward);
the test forward is a forward that you declare in the struts config (it's a
redirection to your jsp)
you can declare it like this:
/jsp/mod1/test.jsp
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org