atom feed9 messages in org.apache.struts.userRE: Rewriting the URL in a form:form ...
FromSent OnAttachments
Erik HorstkotteDec 6, 2000 11:47 am 
Colin SampaleanuDec 6, 2000 2:21 pm 
Michael WestbayDec 6, 2000 3:24 pm 
Michael WestbayDec 6, 2000 6:38 pm 
Craig R. McClanahanDec 7, 2000 11:36 am 
Craig R. McClanahanDec 7, 2000 11:36 am 
Erik HorstkotteDec 7, 2000 11:41 am 
Michael WestbayDec 7, 2000 3:54 pm 
Erik HorstkotteDec 7, 2000 6:15 pm 
Subject:RE: Rewriting the URL in a form:form action
From:Colin Sampaleanu (col@Bspark.com)
Date:Dec 6, 2000 2:21:08 pm
List:org.apache.struts.user

The action parameter can handle a runtime expression, so you should be able to build a custom value in there that includes the context path...

-----Original Message----- From: eri@msoft.com [mailto:eri@msoft.com] Sent: December 6, 2000 2:48 PM To: stru@jakarta.apache.org Subject: Rewriting the URL in a form:form action

I've got a system with a large number of JSPs that I'm developing using Tomcat 3.2 and Struts 1.0 (12/4 nightly build). Because of the large number of files, I've started organizing the them in subdirectories. This has caused me to run into a problem, however. There doesn't appear to be any way to cause the URL in a <form:form> tag's "action" parameter to be rewritten using the webapp's context path. As a result, if I use an action="x", it directs the action to x in the current directory, which in my case isn't what I want. If I use an action="/x", it directs the action to the x in the web server's root directory - not the root of my webapp context, which is what I want.

I tried embedding <form:rewrite page="x"> inside the action= of the <form:form>, but predictably that does not make jasper happy at all: "Attribute has no value" - note the empty attribute name in the message.

Does anyone have ideas on how to make this fly, or do I simply have to go back to a flat directory structure?

-- Erik