You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Hayrol Reyes (JIRA)" <ji...@apache.org> on 2007/08/29 17:50:35 UTC

[jira] Commented: (STR-768) [taglib] html:form tag always prepends context path to action via getActionMappingURL

    [ https://issues.apache.org/struts/browse/STR-768?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42060 ] 

Hayrol Reyes commented on STR-768:
----------------------------------

Hello, I think that this issue is very interesting.

I'm having problems with some application that need to work in a production IAS environment where is accessed through http://www.domain.com/appname .. but internaly the application is installed on one IAS server on the port 7778 (even that this environment has two IAS server).

Here is the problem description:

This application use Struts 1.1 and Hibernate 3 over a OraclaeAS 10g (10.1.0.2). The ApplicatiĆ³n works very well in the developer's IAS, but doesn't in the production's IAS (OAS) ...it's supposed that both OAS use the same configuration.

The problems occurss when the application need to do a ActionForward (redirect true), after a simple update/insert into the DB (with Hibernate). the flow is as follow:
 1).- The "show_Product.do" is launched and it goes well and show the Product.jsp (with the show product secction actived) .
 2).- The user press the "Update" buttom, then the "edit_Product.do" action is executed and the Product.jsp is showed (with the edit product secction actived).
 3).- The user modify the product info and press the "Save" buttom, then the "edit_Product.do" action is executed with the parameter "save" ..... after that the action class calls to the "save" process of the ProductForm class and the next ActionForward is configured to point to "show_Product.do" with the correct parameters. After the commit to the DB the action es executed and "show_Product.do" show the Product.jsp with relevant changes included.

All this normal aproach works very well in our developers environment IAS but doesn't in the produccion IAS. In the production environment the application commited the changes but the last ActionForward (show_Product.do) is not executed and the browser show a "Error Page" related to the conecction problems, however the changes are commited correctly in the DB.

The only diference between both IAS are that the developer environment use a host like: http://servername:7777/context/ while the production environment use: http://www.host.bla/context .... and internaly it's supposed to be pointing to 7778 port of the IAS server (where the app is installed). Both server can be reached through the intranet.

The other diference (with no incidence I guess) is the production IAS is accesing a RAC Oracle DB 10g (2 instances) while the developer IAS is accesing a single Oracle DB 10g.

Does it something to do with the FormTag and the "relative" parameter of the Struts .... in other words, Is the Struts application losing the correct path due to relativities of URL?

Is it a "redirect" problems and Struts is colliding with "port redirect" on the production IAS?

Some body have a clue about what is happing on he producction IAS?

I know that it looks like a Oracle AS problem, but we can't found any help nor support, and the worse is that we have not a error to walk around. We only get a Erorr page and no other information neither app log nor IAS log.

Please, if somebody had experiences with this type of issue, I will apreciate the help.

Regards,

Hayrol Reyes

> [taglib] html:form tag always prepends context path to action via getActionMappingURL
> -------------------------------------------------------------------------------------
>
>                 Key: STR-768
>                 URL: https://issues.apache.org/struts/browse/STR-768
>             Project: Struts 1
>          Issue Type: Improvement
>          Components: Taglibs
>    Affects Versions: Nightly Build
>         Environment: Operating System: other
> Platform: Other
>            Reporter: Jason Taylor
>            Priority: Minor
>
> The getActionMappingURL method in FormTag.java always prepends the context to 
> an action and makes pure relative URL references impossible.  Therefore, a 
> multi-tier architecture which maps "app-name.domain1.com/login.do" 
> to "domain2.com/app-name/login.do" cannot work with Struts form tags.  
> Why would you want to do such a thing, you ask?  In some cases, it is 
> considered more secure to restrict access to a back-end servlet container 
> through a front-end web server via some sort of bridge.  The bridge may further 
> shield the back-end server by mapping an app-specific domain to the back end 
> server's domain.  That way access to applications can be managed on the 
> network/firewall level in addition to container and application levels.  The 
> key to this strategy is avoiding absolute URL references.  
> Always including the context path in the action attribute of the html:form tag 
> makes such an architecture impossible without subclassing the off-the-shelf 
> Struts 1.1b2 version of FormTag.java.  Perhaps the prepending of the context 
> could be optional depending on a boolean attribute of <html:form>, 
> e.g., "<html:form action=/foo relative=true>".  As an aside, as far as I can 
> tell, it's not really necessary to include the context path since "foo.do" is 
> resolved to "/app-name/foo.do" within the "app-name" context.  What's the 
> reason context is always pre-pended?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.