You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by mo...@physics.gmu.edu on 2003/09/25 17:30:47 UTC

Urgent: Changing URLs for existing struts project

Hi All
I am currently running tomcat4.1.27 and apache1.3.x. I am using struts. I
used call my webapplication "xyz" using www.abc.org/xyz. Now company has
decided that pople should be able to access this webapplication through
the URL

www.abc/javapps/xyz. Do i need to change the whole architecture now or
should i be able to do it easily. I have tried to create a directory under
/var/tomcat4/webapps/ as japps/xyz and pointed my ".war" file to this
directory. But tomcat is not able to map this URL at all. Please help me
find a solution to this problem.


Thanx in advance

--Mohan




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


Re: Urgent: Changing URLs for existing struts project

Posted by mo...@physics.gmu.edu.
Because i was already using mod_jk2 , the best to configure was to change
it to add the Context in the server.xml with the desired URL. This is cool
isnt it....Mailing List are great

thanx to u all
--Mohan


> If you have developed your application in "struts friendly" way, this
> should be as easy as changing....
>
>   <servlet-mapping>
>     <servlet-name>action</servlet-name>
>     <url-pattern>*.do</url-pattern>
>   </servlet-mapping>
>
> to
>
>   <servlet-mapping>
>     <servlet-name>action</servlet-name>
>     <url-pattern>/javapps/*.do</url-pattern>
>   </servlet-mapping>
>
>
>
>  or (for path mapping)
>
>   <servlet-mapping>
>     <servlet-name>action</servlet-name>
>     <url-pattern>/myapp/*</url-pattern>
>   </servlet-mapping>
>
>   <servlet-mapping>
>     <servlet-name>action</servlet-name>
>     <url-pattern>/javapps/myapp/*</url-pattern>
>   </servlet-mapping>
>
>
> ...in the web.xml
>
>
> I just tested this on the project I am currently working on and it works
> fine.  My login page now posts to "/javapps/harland/security" whereas it
> used to be "/harland/security".  I can also change it back and forth
> from extension mapping to path mapping by simply modifying the
> <url-patter> to any of the above values.
>
> Best I can tell you is to make the change (as noted above) and run your
> test suite.  You did build a test suite right?
>
>
>
> --
> James Mitchell
> Software Engineer / Struts Evangelist
> http://www.struts-atlanta.org
> 678.910.8017
> 770.822.3359
> AIM:jmitchtx
>
>
>
> ----- Original Message -----
> From: <mo...@physics.gmu.edu>
> To: <st...@jakarta.apache.org>
> Sent: Thursday, September 25, 2003 11:30 AM
> Subject: Urgent: Changing URLs for existing struts project
>
>
>> Hi All
>> I am currently running tomcat4.1.27 and apache1.3.x. I am using
>> struts. I used call my webapplication "xyz" using www.abc.org/xyz. Now
>> company has decided that pople should be able to access this
>> webapplication through the URL
>>
>> www.abc/javapps/xyz. Do i need to change the whole architecture now or
>> should i be able to do it easily. I have tried to create a directory
>> under /var/tomcat4/webapps/ as japps/xyz and pointed my ".war" file to
>> this directory. But tomcat is not able to map this URL at all. Please
>> help me find a solution to this problem.
>>
>>
>> Thanx in advance
>>
>> --Mohan
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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: Urgent: Changing URLs for existing struts project

Posted by James Mitchell <jm...@apache.org>.
If you have developed your application in "struts friendly" way, this should
be as easy as changing....

  <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
  </servlet-mapping>

to

  <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>/javapps/*.do</url-pattern>
  </servlet-mapping>



 or (for path mapping)

  <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>/myapp/*</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>/javapps/myapp/*</url-pattern>
  </servlet-mapping>


...in the web.xml


I just tested this on the project I am currently working on and it works
fine.  My login page now posts to "/javapps/harland/security" whereas it
used to be "/harland/security".  I can also change it back and forth from
extension mapping to path mapping by simply modifying the <url-patter> to
any of the above values.

Best I can tell you is to make the change (as noted above) and run your test
suite.  You did build a test suite right?



--
James Mitchell
Software Engineer / Struts Evangelist
http://www.struts-atlanta.org
678.910.8017
770.822.3359
AIM:jmitchtx



----- Original Message ----- 
From: <mo...@physics.gmu.edu>
To: <st...@jakarta.apache.org>
Sent: Thursday, September 25, 2003 11:30 AM
Subject: Urgent: Changing URLs for existing struts project


> Hi All
> I am currently running tomcat4.1.27 and apache1.3.x. I am using struts. I
> used call my webapplication "xyz" using www.abc.org/xyz. Now company has
> decided that pople should be able to access this webapplication through
> the URL
>
> www.abc/javapps/xyz. Do i need to change the whole architecture now or
> should i be able to do it easily. I have tried to create a directory under
> /var/tomcat4/webapps/ as japps/xyz and pointed my ".war" file to this
> directory. But tomcat is not able to map this URL at all. Please help me
> find a solution to this problem.
>
>
> Thanx in advance
>
> --Mohan
>
>
>
>
> ---------------------------------------------------------------------
> 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: Urgent: Changing URLs for existing struts project

Posted by "Craig R. McClanahan" <cr...@apache.org>.
mohan@physics.gmu.edu wrote:

>Hi All
>I am currently running tomcat4.1.27 and apache1.3.x. I am using struts. I
>used call my webapplication "xyz" using www.abc.org/xyz. Now company has
>decided that pople should be able to access this webapplication through
>the URL
>
>www.abc/javapps/xyz. Do i need to change the whole architecture now or
>should i be able to do it easily. I have tried to create a directory under
>/var/tomcat4/webapps/ as japps/xyz and pointed my ".war" file to this
>directory. But tomcat is not able to map this URL at all. Please help me
>find a solution to this problem.
>  
>
As Matt pointed out, this is really a Tomcat question, but it's actually 
pretty (assuming you don't want it accessible under the old name any 
longer).  Just set up a <Context> element that includes 
path="/javapps/xyz" instead of path="/xyz".  For more info, see the 
config documentation in Tomcat:

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/index.html

>
>Thanx in advance
>
>--Mohan
>
Craig

>
>
>
>
>---------------------------------------------------------------------
>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