RE: html:form tag

2003-12-08 Thread Viral_Thakkar
Yes, u r rite.

Thanks kadir for prompt reply.

-Original Message-
From: Kathiresan Murugesan [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 08, 2003 2:06 PM
To: Viral_Thakkar
Subject: RE: html:form tag

 Hi 

You can use the name attribute value you given in your form bean mapping
in
your struts-config.xml. That will be the name of your form.

kadir

-Original Message-
From: Viral_Thakkar
To: Struts Users Mailing List
Sent: 12/8/2003 1:53 PM
Subject: html:form tag

I am converting a html form to .jsp page. Html file contains following
form code.

 tag.

This form name is getting used by few javascript functions.

At present I have this line in .jsp page for form tag.


Which attribute in the html:form tag represents the "name" attribute of
"form" tag?




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

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



RE: html:form tag and coupling between ActionForm and Action

2003-07-21 Thread Alex Shneyderman
Actually I meant something like this:

Create BaseAction with three methods {
protected ActionForm createForm (
HttpServletRequest request,
String actionName) throws Exception {
ModuleConfig mc = RequestUtils.getRequestModuleConfig (request);
ActionMapping am = (ActionMapping) mc.findActionConfig
(actionName);
return RequestUtils.createActionForm (request, am, mc,
getServlet ());
}

protected void attachForm (
HttpServletRequest request,
String actionName,
ActionForm form) throws Exception {
ModuleConfig mc = RequestUtils.getRequestModuleConfig (request);
ActionMapping am = (ActionMapping) mc.findActionConfig
(actionName);

if ((am.getScope () == null) || (am.getScope ().equalsIgnoreCase
("session"))) {
request.getSession ().setAttribute (am.getName (), form);
} else {
request.setAttribute (am.getName (), form);
}
}

protected void removeForm (HttpServletRequest request, String
actionName) {
ModuleConfig mc = RequestUtils.getRequestModuleConfig (request);
ActionMapping am = (ActionMapping) mc.findActionConfig
(actionName);

if ((am.getScope () == null) || (am.getScope ().equalsIgnoreCase
("session"))) {
request.getSession ().removeAttribute (am.getName ());
} else {
request.removeAttribute (am.getName ());
}   
}
}

You can use theese 3 methods in actions that need to Dispatch (that is
why my BaseAction extends DispatchAction). So you get request:
createForm you need, populate its values, attachForm  and redirect to
the view you want to see it in. Be careful not to redirect to action
that uses the form you just populated, it might wipe out all work you
have done.

If you use application scope forms you would have to add it in. I never
do so it is not there.

Alex.

> -Original Message-
> From: Suzette Daniel [mailto:[EMAIL PROTECTED]
> Sent: Monday, July 21, 2003 12:41 PM
> To: 'Struts Users Mailing List'
> Subject: RE: html:form tag and coupling between ActionForm and Action
> 
> I just wanted to add a little bit more to Alex's comment.
> 
> 1.Create a form interface that represents your family of forms
>   abstract class PersonForm extends ActionForm{
>   getFirstName();
>   getLastName();
>   getMiddleName();
>   }
> 2.Make your forms implement that interface
> 3.In your action cast ActionForm to your interface
>   PersonProcessingAction extends Action {
>   
>   Person personForm = (PersonForm)form;
>   String first = personForm.getFirstName();
>   
>   }
> 
> 
> -Original Message-
> From: Alex Shneyderman [mailto:[EMAIL PROTECTED]
> Sent: Monday, July 21, 2003 12:31 PM
> To: 'Struts Users Mailing List'
> Subject: RE: html:form tag and coupling between ActionForm and Action
> 
> 
> 
> 
> > What if you want to write an Action that can service a
> > family of several different ActionForms??
> 
> You can do it. Just need to do it yourself (well sort of).
> 
> Alex.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



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



RE: html:form tag and coupling between ActionForm and Action

2003-07-21 Thread Brendan . Johnston
I don't think Daniel's idea will work.

If the action form does not exist then
struts wants to instantiate the form.

Therefore struts needs to know the type.

It might work if you have a session scope form already there.

I think of actions as the most dependent class,
i.e. nothing should depend on actions (no other classes should know anything
about actions),
actions should depend on everything (well not everything, but definitely the
model and the view).

Because they are such nasty beasts, (and because in struts they should have
no state),
they should be very small.

Since they are so small the architecture that puts effort into 
making them generic and reusable may be misguided.

Brendan


-Original Message-
From: Suzette Daniel [mailto:[EMAIL PROTECTED]
Sent: Monday, July 21, 2003 9:41 AM
To: 'Struts Users Mailing List'
Subject: RE: html:form tag and coupling between ActionForm and Action


I just wanted to add a little bit more to Alex's comment. 

1.Create a form interface that represents your family of forms
abstract class PersonForm extends ActionForm{
getFirstName();
getLastName();
getMiddleName();
}
2.Make your forms implement that interface
3.In your action cast ActionForm to your interface 
PersonProcessingAction extends Action {

Person personForm = (PersonForm)form;
String first = personForm.getFirstName();

}


-Original Message-
From: Alex Shneyderman [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 21, 2003 12:31 PM
To: 'Struts Users Mailing List'
Subject: RE: html:form tag and coupling between ActionForm and Action




> What if you want to write an Action that can service a
> family of several different ActionForms??

You can do it. Just need to do it yourself (well sort of).

Alex.


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

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

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



RE: html:form tag and coupling between ActionForm and Action

2003-07-21 Thread Suzette Daniel
I just wanted to add a little bit more to Alex's comment. 

1.Create a form interface that represents your family of forms
abstract class PersonForm extends ActionForm{
getFirstName();
getLastName();
getMiddleName();
}
2.Make your forms implement that interface
3.In your action cast ActionForm to your interface 
PersonProcessingAction extends Action {

Person personForm = (PersonForm)form;
String first = personForm.getFirstName();

}


-Original Message-
From: Alex Shneyderman [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 21, 2003 12:31 PM
To: 'Struts Users Mailing List'
Subject: RE: html:form tag and coupling between ActionForm and Action




> What if you want to write an Action that can service a
> family of several different ActionForms??

You can do it. Just need to do it yourself (well sort of).

Alex.


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

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



RE: html:form tag and coupling between ActionForm and Action

2003-07-21 Thread Alex Shneyderman


> What if you want to write an Action that can service a
> family of several different ActionForms??

You can do it. Just need to do it yourself (well sort of).

Alex.


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



RE: html:form tag - specify rendered action

2003-03-28 Thread Kuntz, Tim
Exactly. Hmmm.. I didn't think of a JavaScript solution but that might be an
option I could investigate.  After looking at the source for the html:form
taglib, I think my best bet is extending the tag class and updating the tld
to allow for an additional attribute that handles my specific business need.

Thanks for your input.

-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED]

On Fri, 2003-03-28 at 14:04, Kuntz, Tim wrote:
> Our legacy MVC uses servlet mapping by path "/legacy/*" and Struts is
mapped
> by extension "*.do". 
> 
> The legacy servlet initializes user information and adds it to the request
> object. It then prepends the request.getRequestURI() with "/root" and uses
> the RequestDispatcher to dispatch the request to Struts.  We prepend the
> request URI with "/root" so the legacy servlet doesn't dispatch to itself.
> We also do this because we wrote our own templating system similar to
> SiteMesh without servlet filters... but that's another story.
> 
> Struts is doing exactly what it should be doing in a "normal" application.
> In my case, I just need to modify that behavior so I can get it to work in
> my environment.

I see.  So you want to take advatage of the form handling capabilities
of the html:form tag without it prepending the context?

Interesting.  Would a JavaScript solution work for you?

> 
> -Original Message-
> From: James Mitchell [mailto:[EMAIL PROTECTED]
> 
> On Fri, 2003-03-28 at 13:43, Kuntz, Tim wrote:
> > Sorry, "the framework" refers to my legacy MVC framework and we use a
> > sub-directory named "/root" to store the views (jsps). So while my page
is
> > "/root/legacy/struts.jsp", I want the form to post back to
> > "/legacy/struts.tpc" so my legacy servlet will setup the request prior
to
> > handing it off to Struts.
> 
> I see.  What is your legacy servlet doing to the request?  It appears to
> be confusing Struts.
> 
> > 
> > -Original Message-
> > From: James Mitchell [mailto:[EMAIL PROTECTED]
> 
> > On Fri, 2003-03-28 at 12:16, Kuntz, Tim wrote:
> > > Is it possible to manually control the rendered form action attribute?

> > > 
> > > I am migrating and existing MVC framework to Struts and have the
> > requirement
> > > that the two frameworks run in tandem. The existing framework has a
> front
> > > servlet that is responsible for user initialization, security, etc...
It
> > > then modifies the path and forwards to a view which in my case will be
> the
> > > Struts application. So the user submits to "/legacy/struts.do" but
> Struts
> > > receives "/root/legacy/struts.do" and the page is
> > "/root/legacy/struts.jsp".
> > > 
> > > 
> > > The html:form tag  with an action of "/struts.do" currently sets the
> > action
> > > to "/root/legacy/struts.do" and I need it to be "/legacy/struts.do".
> > > 
> > > Has anyone else dealt with this issue?
> > 
> > The framework is only prepending the context (request.getContextPath()).
> > 
> > Are you sure it's 'root' and not 'ROOT'?
> > 
> > 
> > > 
> > > thanks,
> > > tim
> > > 
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > -- 
> > James Mitchell
> > Software Developer/Struts Evangelist
> > http://www.open-tools.org
> > 
> > 
> > 
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> -- 
> James Mitchell
> Software Developer/Struts Evangelist
> http://www.open-tools.org
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
-- 
James Mitchell
Software Developer/Struts Evangelist
http://www.open-tools.org




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

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



RE: html:form tag - specify rendered action

2003-03-28 Thread James Mitchell
On Fri, 2003-03-28 at 14:04, Kuntz, Tim wrote:
> Our legacy MVC uses servlet mapping by path "/legacy/*" and Struts is mapped
> by extension "*.do". 
> 
> The legacy servlet initializes user information and adds it to the request
> object. It then prepends the request.getRequestURI() with "/root" and uses
> the RequestDispatcher to dispatch the request to Struts.  We prepend the
> request URI with "/root" so the legacy servlet doesn't dispatch to itself.
> We also do this because we wrote our own templating system similar to
> SiteMesh without servlet filters... but that's another story.
> 
> Struts is doing exactly what it should be doing in a "normal" application.
> In my case, I just need to modify that behavior so I can get it to work in
> my environment.

I see.  So you want to take advatage of the form handling capabilities
of the html:form tag without it prepending the context?

Interesting.  Would a JavaScript solution work for you?

> 
> -Original Message-
> From: James Mitchell [mailto:[EMAIL PROTECTED]
> 
> On Fri, 2003-03-28 at 13:43, Kuntz, Tim wrote:
> > Sorry, "the framework" refers to my legacy MVC framework and we use a
> > sub-directory named "/root" to store the views (jsps). So while my page is
> > "/root/legacy/struts.jsp", I want the form to post back to
> > "/legacy/struts.tpc" so my legacy servlet will setup the request prior to
> > handing it off to Struts.
> 
> I see.  What is your legacy servlet doing to the request?  It appears to
> be confusing Struts.
> 
> > 
> > -Original Message-
> > From: James Mitchell [mailto:[EMAIL PROTECTED]
> 
> > On Fri, 2003-03-28 at 12:16, Kuntz, Tim wrote:
> > > Is it possible to manually control the rendered form action attribute? 
> > > 
> > > I am migrating and existing MVC framework to Struts and have the
> > requirement
> > > that the two frameworks run in tandem. The existing framework has a
> front
> > > servlet that is responsible for user initialization, security, etc... It
> > > then modifies the path and forwards to a view which in my case will be
> the
> > > Struts application. So the user submits to "/legacy/struts.do" but
> Struts
> > > receives "/root/legacy/struts.do" and the page is
> > "/root/legacy/struts.jsp".
> > > 
> > > 
> > > The html:form tag  with an action of "/struts.do" currently sets the
> > action
> > > to "/root/legacy/struts.do" and I need it to be "/legacy/struts.do".
> > > 
> > > Has anyone else dealt with this issue?
> > 
> > The framework is only prepending the context (request.getContextPath()).
> > 
> > Are you sure it's 'root' and not 'ROOT'?
> > 
> > 
> > > 
> > > thanks,
> > > tim
> > > 
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > -- 
> > James Mitchell
> > Software Developer/Struts Evangelist
> > http://www.open-tools.org
> > 
> > 
> > 
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> -- 
> James Mitchell
> Software Developer/Struts Evangelist
> http://www.open-tools.org
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
-- 
James Mitchell
Software Developer/Struts Evangelist
http://www.open-tools.org




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



RE: html:form tag - specify rendered action

2003-03-28 Thread Kuntz, Tim
Our legacy MVC uses servlet mapping by path "/legacy/*" and Struts is mapped
by extension "*.do". 

The legacy servlet initializes user information and adds it to the request
object. It then prepends the request.getRequestURI() with "/root" and uses
the RequestDispatcher to dispatch the request to Struts.  We prepend the
request URI with "/root" so the legacy servlet doesn't dispatch to itself.
We also do this because we wrote our own templating system similar to
SiteMesh without servlet filters... but that's another story.

Struts is doing exactly what it should be doing in a "normal" application.
In my case, I just need to modify that behavior so I can get it to work in
my environment.

-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED]

On Fri, 2003-03-28 at 13:43, Kuntz, Tim wrote:
> Sorry, "the framework" refers to my legacy MVC framework and we use a
> sub-directory named "/root" to store the views (jsps). So while my page is
> "/root/legacy/struts.jsp", I want the form to post back to
> "/legacy/struts.tpc" so my legacy servlet will setup the request prior to
> handing it off to Struts.

I see.  What is your legacy servlet doing to the request?  It appears to
be confusing Struts.

> 
> -Original Message-
> From: James Mitchell [mailto:[EMAIL PROTECTED]

> On Fri, 2003-03-28 at 12:16, Kuntz, Tim wrote:
> > Is it possible to manually control the rendered form action attribute? 
> > 
> > I am migrating and existing MVC framework to Struts and have the
> requirement
> > that the two frameworks run in tandem. The existing framework has a
front
> > servlet that is responsible for user initialization, security, etc... It
> > then modifies the path and forwards to a view which in my case will be
the
> > Struts application. So the user submits to "/legacy/struts.do" but
Struts
> > receives "/root/legacy/struts.do" and the page is
> "/root/legacy/struts.jsp".
> > 
> > 
> > The html:form tag  with an action of "/struts.do" currently sets the
> action
> > to "/root/legacy/struts.do" and I need it to be "/legacy/struts.do".
> > 
> > Has anyone else dealt with this issue?
> 
> The framework is only prepending the context (request.getContextPath()).
> 
> Are you sure it's 'root' and not 'ROOT'?
> 
> 
> > 
> > thanks,
> > tim
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> -- 
> James Mitchell
> Software Developer/Struts Evangelist
> http://www.open-tools.org
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
-- 
James Mitchell
Software Developer/Struts Evangelist
http://www.open-tools.org




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

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



RE: html:form tag - specify rendered action

2003-03-28 Thread James Mitchell
On Fri, 2003-03-28 at 13:43, Kuntz, Tim wrote:
> Sorry, "the framework" refers to my legacy MVC framework and we use a
> sub-directory named "/root" to store the views (jsps). So while my page is
> "/root/legacy/struts.jsp", I want the form to post back to
> "/legacy/struts.tpc" so my legacy servlet will setup the request prior to
> handing it off to Struts.

I see.  What is your legacy servlet doing to the request?  It appears to
be confusing Struts.

> 
> -Original Message-
> From: James Mitchell [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 28, 2003 11:42 AM
> To: Struts Users Mailing List
> Subject: Re: html:form tag - specify rendered action
> 
> 
> On Fri, 2003-03-28 at 12:16, Kuntz, Tim wrote:
> > Is it possible to manually control the rendered form action attribute? 
> > 
> > I am migrating and existing MVC framework to Struts and have the
> requirement
> > that the two frameworks run in tandem. The existing framework has a front
> > servlet that is responsible for user initialization, security, etc... It
> > then modifies the path and forwards to a view which in my case will be the
> > Struts application. So the user submits to "/legacy/struts.do" but Struts
> > receives "/root/legacy/struts.do" and the page is
> "/root/legacy/struts.jsp".
> > 
> > 
> > The html:form tag  with an action of "/struts.do" currently sets the
> action
> > to "/root/legacy/struts.do" and I need it to be "/legacy/struts.do".
> > 
> > Has anyone else dealt with this issue?
> 
> The framework is only prepending the context (request.getContextPath()).
> 
> Are you sure it's 'root' and not 'ROOT'?
> 
> 
> > 
> > thanks,
> > tim
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> -- 
> James Mitchell
> Software Developer/Struts Evangelist
> http://www.open-tools.org
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
-- 
James Mitchell
Software Developer/Struts Evangelist
http://www.open-tools.org




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



RE: html:form tag - specify rendered action

2003-03-28 Thread Kuntz, Tim
Sorry, "the framework" refers to my legacy MVC framework and we use a
sub-directory named "/root" to store the views (jsps). So while my page is
"/root/legacy/struts.jsp", I want the form to post back to
"/legacy/struts.tpc" so my legacy servlet will setup the request prior to
handing it off to Struts.

-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED]
Sent: Friday, March 28, 2003 11:42 AM
To: Struts Users Mailing List
Subject: Re: html:form tag - specify rendered action


On Fri, 2003-03-28 at 12:16, Kuntz, Tim wrote:
> Is it possible to manually control the rendered form action attribute? 
> 
> I am migrating and existing MVC framework to Struts and have the
requirement
> that the two frameworks run in tandem. The existing framework has a front
> servlet that is responsible for user initialization, security, etc... It
> then modifies the path and forwards to a view which in my case will be the
> Struts application. So the user submits to "/legacy/struts.do" but Struts
> receives "/root/legacy/struts.do" and the page is
"/root/legacy/struts.jsp".
> 
> 
> The html:form tag  with an action of "/struts.do" currently sets the
action
> to "/root/legacy/struts.do" and I need it to be "/legacy/struts.do".
> 
> Has anyone else dealt with this issue?

The framework is only prepending the context (request.getContextPath()).

Are you sure it's 'root' and not 'ROOT'?


> 
> thanks,
> tim
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
-- 
James Mitchell
Software Developer/Struts Evangelist
http://www.open-tools.org




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

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



Re: html:form tag - specify rendered action

2003-03-28 Thread James Mitchell
On Fri, 2003-03-28 at 12:16, Kuntz, Tim wrote:
> Is it possible to manually control the rendered form action attribute? 
> 
> I am migrating and existing MVC framework to Struts and have the requirement
> that the two frameworks run in tandem. The existing framework has a front
> servlet that is responsible for user initialization, security, etc... It
> then modifies the path and forwards to a view which in my case will be the
> Struts application. So the user submits to "/legacy/struts.do" but Struts
> receives "/root/legacy/struts.do" and the page is "/root/legacy/struts.jsp".
> 
> 
> The html:form tag  with an action of "/struts.do" currently sets the action
> to "/root/legacy/struts.do" and I need it to be "/legacy/struts.do".
> 
> Has anyone else dealt with this issue?

The framework is only prepending the context (request.getContextPath()).

Are you sure it's 'root' and not 'ROOT'?


> 
> thanks,
> tim
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
-- 
James Mitchell
Software Developer/Struts Evangelist
http://www.open-tools.org




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



Re: html:form tag within a logic:equal tag currupts html output

2002-01-08 Thread David M. Karr

> "Jim" == Jim Calder <[EMAIL PROTECTED]> writes:

Jim> I have a form which has three modes; Create, Edit, and View.  When the form
Jim> is  Create or 
Jim> Edit, I want to place the focus on the first field (longName).  But when I
Jim> use a logic:equal 
Jim> tag to determine the correct html:form tag, I get a corrupted html file.  Is
Jim> there another solution 
Jim> besides the logic:equals tag?
 
Jim> [ [ JSP Page ] ]
Jim> 
Jim>  scope="request" value="View">
Jim>   
Jim> 
Jim>   scope="request" value="View">
Jim>   
Jim> 
Jim> ...  
Jim> 
Jim> 

Jim> [ [ Rendered HTML - performing an Edit ] ]
 
Jim> 
Jim>action="/myApp/accountDetailsSave.do">
Jim> 
Jim> 
 
You can't "overlap" tag regions.  It's not valid XML.  At the least, you'd have
to have two complete "html:form" elements, including all of their contents,
each in either the "notEqual" or "equal" case.

However, if the contents of the two forms are identical, except for needing
focus in one field in one case, then you might consider having a single form,
but using a runtime value for the "focus" attribute (note the javadoc shows an
RT value for this is legal).  Use an expression which evaluates to "longName"
in the "equal" case, and equal to "" in the "notEqual" case.  I would assume a
"focus" value of an empty string would essentially be a noop (untested).

-- 
===
David M. Karr  ; Best Consulting
[EMAIL PROTECTED]   ; Java/Unix/XML/C++/X ; BrainBench CJ12P (#12004)


--
To unsubscribe, e-mail:   
For additional commands, e-mail: