The struts custom tags output simple html at runtime.  So when you're
writing the JSP, it really makes little difference which tag you use.  At
runtime, the input tags will always be nested within a form tag, whether the
original JSP uses the form or html:form tag.
Does that make sense to ya?

~ Keith
http://www.buffalo.edu/~kkamholz



-----Original Message-----
From: Mark Meytin [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 01, 2002 5:37 PM
To: Struts Users Mailing List
Subject: Re: Using relative actions in html:form attributes...


Hmm, interesting...  I was under impression that Struts
enforces the fact that form element tags must be inside
html:form tags.  Well, after your suggestion, I tried putting
them inside the regular form tags, and it did not complain.
So, at least in this version of Struts (1.0.2) it seems
to work.  I also had to add "name" attribute to every single
element of the form, otherwise I was getting the
following exception:

javax.servlet.jsp.JspException: Cannot find bean
org.apache.struts.taglib.html.BEAN in scope null
         at
org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:493)
         at
org.apache.struts.taglib.html.BaseFieldTag.doStartTag(BaseFieldTag.java:188)
         ....

which is understandable, since without that attribute and without
enclosing html:form, elements have no idea where to find their
values.  Well, at least now I have a workaround, albeit not a
very clean one, in my opinion.  I still don't understand why
not let html:form use relative actions, perhaps I'm missing
something here.  In any case, thanks, Troy - your input
is much appreciated!

-M-

Troy Hart wrote:

> I'm not so sure that is correct. It seems like I have done this before,
> but I don't recall for sure. I am in the middle of some other stuff and
> don't have time to test it now, but you should give it a quick try. Or,
> maybe you already have?
> 
> Good Luck,
> 
> Troy
> 
> On Thu, 2002-08-01 at 15:05, Mark Meytin wrote:
> 
>>That would work of course, but as a result I won't be
>>able to use other html tags that go inside html:form,
>>such as html:select, html:text, etc - and therefore
>>abandon a large chunk of functionality provided by Struts.
>>I'm kinda curious why Struts developers would not
>>simply allow relative action elements, perhaps if a
>>special attribute was present.  Perhaps this is
>>a question for dev-list.
>>
>>Thanks for your answer,
>>-M-
>>
>>Troy Hart wrote:
>>
>>
>>>One very simple thing to do is forgo the use of <html:form> in favor of
>>>the plain html <form>.
>>>
>>>Troy
>>>
>>>
>>>
>>>On Thu, 2002-08-01 at 13:23, Mark Meytin wrote:
>>>
>>>
>>>>Hello!
>>>>
>>>>I have the following interesting problem with Struts 1.0.2 running under
>>>>Tomcat 4.0.4 and Apache combo.  I would like to specify relative
>>>>actions in the html:form tags.  The problem now is that html:form
>>>>tag converts action attributes into absolute paths, for example
>>>>if I specify action="search.do" in html:form tags, the
>>>>resulting HTML page contains <form action="/myapp/search.do">
>>>>tag, where it gets /myapp prefix by always unconditionally making
>>>>a call to request.getContextPath().  Well, in my case this is not
>>>>working, because due to the use of Apache ProxyPass statements,
>>>>URLs of the pages do not correspond to Tomcat ContextPaths.  
>>>>Specifically, my JSP files are located in /webapps/superapp/subdir
>>>>directory, through the magic of the following ProxyPass statements:
>>>>
>>>>ProxyPass         /subdir         http://localhost:8080/superapp/subdir
>>>>ProxyPassReverse  /subdir         http://localhost:8080/superapp/subdir
>>>>
>>>>I can access my pages by going to http://<myhost>/subdir/page.jsp
>>>>and my actions as http://<myhost>/subdir/action.do.  But because
>>>>html:form tag generates a link to /superapp/subdir/action.do my
>>>>forms cannot access the action at all, resulting in Apache's 404
>>>>result.  
>>>>
>>>>Any ideas will be much appreciated!  It there a way to handle this
>>>>type of situation, when Apache URLs do not correspond to
>>>>Tomcat ContextPath URLs?  I'm getting a bit desperate here ;^)
>>>>
>>>>-M-
>>>>
>>>>
>>>>
>>>>--
>>>>To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
>>>>For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>>>>
>>>
>>>
>>>--
>>>To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
>>>For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>>>
>>
>>
>>--
>>To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
>>For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>>
> 
> 
> 
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
> 



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

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

Reply via email to