• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts - how to prepend to the URL?

 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I developed my struts app on BEA where I had a URL like this: http://host.com:7001/myApp/index.do
In our production environment, we're using an Apache front end, so the BEA stuff has been aliased to something like this: http://host.com/BEA/myApp/index.do

Going to that first page works fine, but when I click on a link the "/BEA" gets cut out of the URL and it goes to: http://host.com/myApp/page2.do

In all my pages I use a link like this: <html:link action="/page2" >asdf</html:link>

Originally I thought that using the "forwardPattern" in my struts-config <controller> was the right way to fix this, but its not working yet...

any ideas?
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try:

web.xml

<init-param>
<param-name>config/BEA</param-name>
<param-value>WEB-INF/struts-config.xml</param-value>
</init-param>
 
Junilu Lacar
Bartender
Posts: 7486
50
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Marc Peabody:
Try:

web.xml

<init-param>
<param-name>config/BEA</param-name>
<param-value>WEB-INF/struts-config.xml</param-value>
</init-param>


Marc, could you explain how this would help? I'm not grokking it. My first thought was that the problem had something to do with the aliasing of BEA in Apache. I seem to recall encountering a similar problem with Apache and Oracle 9iAS in my last project although I have no idea how that was resolved.
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, the problem isn't something that can or should be addressed in struts

(I posted the same question on the struts-user list and got a reply from Craig McClanahan that put me on the right path)

(Posted by me on the struts user list)

Basically how our apache-BEA bridge worked before was that if Apache saw /BEA at the beginning of the URL, it stripped /BEA from the URL and sent the request to BEA to be serviced. BEA saw the /myApp context and handled the app as per normal. But then when it came time to generate a link, it simply used the context root, having no idea bout the /BEA thing...

SO -- we modified the apache-BEA link to NOT strip out the /BEA from the URL (by commenting out the PathTrim in the httpd.conf), and then adjusted the context-root of the webapp to be /BEA/myApp (using the <context-root> element in the weblogic.xml) and now everything is hunky-dory.

[ July 16, 2004: Message edited by: Jessica Sant ]
 
Junilu Lacar
Bartender
Posts: 7486
50
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jessica Sant:
So, the problem isn't something that can or should be addressed in struts...

SO -- we modified the apache-BEA link to NOT strip out the /BEA from the URL (by commenting out the PathTrim in the httpd.conf), and then adjusted the context-root of the webapp to be /BEA/myApp (using the <context-root> element in the weblogic.xml) and now everything is hunky-dory.


And you didn't even have to call up your legal department...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic