Webapp context

2009-02-19 Thread JPJ

Hi,

 Is there anyway we can prevent the context root of the web application from
prepending to the uri of an action. I know if we use the namespace then the
url is formed by adding
ServerName+ContextRoot+NameSpace+ActionName+".action".

I am not specifying any namespace for my struts pacakge. But when I see the
view source of the jsp my application context root(which is /webapp1) is
preppended to the action value (the URI). So my url is changed to
http://appserver:8080/webapp1/webapp1/Login.action(http://ServerName:port/WebAppContextRoot+/WebAppContextRoot/Action).
The URI is now /webapp1/Login.action where I expect /Login.action. This
created problem for my apache rewrite rules. Is there anyway I can avoid the
webapp context root to prepend to my action value in jsp while rendring the
page? I think this is happening while rendering the FORM tag.

I tried with namespace="/" and namespace="" in struts.xml and form tag but
still the context root is getting appended to action value.


I am using struts2.1.6 and my application server is jboss4.x. I am using
empty namespace in the struts package. My application context is /webapp1
(in jboss-web.xml). 



My jboss-web.xml is like


  
  /webapp1


My struts.xml file is as follows.


http://struts.apache.org/dtds/struts-2.0.dtd";>













/pages/Login.jsp
/pages/Login.jsp 



/pages/Login.jsp
/pages/ListNames.jsp





My Login.jsp is like


...
...


The view source of Login.jsp looks like


...
...



I appreciate your help in this as I tried a lot of options and read a lot of
forums, but nowwhere this issue is raised.

Thanks,
Jinzzz




-- 
View this message in context: 
http://www.nabble.com/Webapp-context-tp22103569p22103569.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Webapp context

2009-02-19 Thread JPJ

Thanks for the quick response. If I uderstood you correctly, the problem with
this solution is that I have more than one web application in my jboss
server.  And I cannot deploy as ROOT for all application on the same server.

Should this be viewed as an issue of FORM tag implementation? I do not know
whether I am making a worthless statements but according my view we should
not prepend the web app context root to the action value in JSP while
rendering. Instead we should only prepend only the name space without
context root.
Any suggestions?

Thanks,
Jinzzz

Aidas Semezys wrote:
> 
> I guess the simplest way to achieve this is to deploy your application 
> as ROOT one under tomcat installations' webapps dir.
> 
> --
> aidas
> 
> JPJ wrote:
>> Hi,
>>
>>  Is there anyway we can prevent the context root of the web application
>> from
>> prepending to the uri of an action. I know if we use the namespace then
>> the
>> url is formed by adding
>> ServerName+ContextRoot+NameSpace+ActionName+".action".
>>
>> I am not specifying any namespace for my struts pacakge. But when I see
>> the
>> view source of the jsp my application context root(which is /webapp1) is
>> preppended to the action value (the URI). So my url is changed to
>> http://appserver:8080/webapp1/webapp1/Login.action(http://ServerName:port/WebAppContextRoot+/WebAppContextRoot/Action).
>> The URI is now /webapp1/Login.action where I expect /Login.action. This
>> created problem for my apache rewrite rules. Is there anyway I can avoid
>> the
>> webapp context root to prepend to my action value in jsp while rendring
>> the
>> page? I think this is happening while rendering the FORM tag.
>>
>> I tried with namespace="/" and namespace="" in struts.xml and form tag
>> but
>> still the context root is getting appended to action value.
>>
>>
>> I am using struts2.1.6 and my application server is jboss4.x. I am using
>> empty namespace in the struts package. My application context is /webapp1
>> (in jboss-web.xml). 
>>
>>
>>
>> My jboss-web.xml is like
>>
>> 
>>   
>>   /webapp1
>> 
>>
>> My struts.xml file is as follows.
>>
>>
>> > "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>> "http://struts.apache.org/dtds/struts-2.0.dtd";>
>>
>> 
>> 
>> 
>> > class="com.abc.custominterceptors.SessionAuthINCR"/>
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> /pages/Login.jsp
>> /pages/Login.jsp 
>> 
>>
>> 
>> /pages/Login.jsp
>> /pages/ListNames.jsp
>> 
>> 
>> 
>> 
>>
>> My Login.jsp is like
>>
>> 
>> ...
>> ...
>> 
>>
>> The view source of Login.jsp looks like
>>
>> 
>> ...
>> ...
>> 
>>
>>
>> I appreciate your help in this as I tried a lot of options and read a lot
>> of
>> forums, but nowwhere this issue is raised.
>>
>> Thanks,
>> Jinzzz
>>
>>
>>
>>
>>   
> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Webapp-context-tp22103569p22104090.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org