Re: html:form dynamic action value

2005-12-12 Thread Laurie Harper

Perry Jeung wrote:

I have a html:form tag with a dynamic action value that works in one version of
Struts and not in another.

I'm new to Tiles and I want to do the following in one of the reusable tiles
named report.jsp:

html:form action=%= (String)request.getAttribute(action) % 

In an experiment, I took the struts-example webapp from the Struts 1.2.8 binary
distributon and modified the html-link.jsp like this:

%
String actionValue = /html-link-submit;
request.setAttribute(action, actionValue);
%
html:form action=%= (String)request.getAttribute(action) %


This works so I go back to my application to do the same thing
but doesn't work.  I get the following error on the html page in the browser:
[ServletException in:/tiles/report.jsp] null'

I'm using a debugger and I can see that the action attribute is defined in the
request context.

Why the difference?  Is it the struts environment?

Both are running on Tomcat 5.0.28.

My app uses Struts 1.1 and has this preamble in web.xml

!DOCTYPE web-app
  PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN
  http://java.sun.com/j2ee/dtds/web-app_2_2.dtd;

The modified struts-example is from Struts 1.2.8 and has the same web.xml
preamble as above.

Would I be right in concluding that the difference is in the Struts version and
that upgrading would solve my problem?
My app has close to 100 pages, so before I start, can anybody offer some
insight as to the root of the problem.


Have you tried your experiment using the examples app from Struts 1.1? 
That might be a useful sanity check before drawing any conclusions. I 
can't offer any insight into the error you're getting without seeing the 
full stacktrace (if then! :-)


L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



html:form dynamic action value

2005-12-11 Thread Perry Jeung
I have a html:form tag with a dynamic action value that works in one version of
Struts and not in another.

I'm new to Tiles and I want to do the following in one of the reusable tiles
named report.jsp:

html:form action=%= (String)request.getAttribute(action) % 

In an experiment, I took the struts-example webapp from the Struts 1.2.8 binary
distributon and modified the html-link.jsp like this:

%
String actionValue = /html-link-submit;
request.setAttribute(action, actionValue);
%
html:form action=%= (String)request.getAttribute(action) %


This works so I go back to my application to do the same thing
but doesn't work.  I get the following error on the html page in the browser:
[ServletException in:/tiles/report.jsp] null'

I'm using a debugger and I can see that the action attribute is defined in the
request context.

Why the difference?  Is it the struts environment?

Both are running on Tomcat 5.0.28.

My app uses Struts 1.1 and has this preamble in web.xml

!DOCTYPE web-app
  PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN
  http://java.sun.com/j2ee/dtds/web-app_2_2.dtd;

The modified struts-example is from Struts 1.2.8 and has the same web.xml
preamble as above.

Would I be right in concluding that the difference is in the Struts version and
that upgrading would solve my problem?
My app has close to 100 pages, so before I start, can anybody offer some
insight as to the root of the problem.

Thanks.

Perry Jeung


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]