You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by mi...@ps.ge.com on 2003/03/13 19:58:15 UTC

[Q] how to get Form name in include JSP?

Hello,

I have jsp include (<%include file="a.jsp"%>)
that has 
<html:text property="start" name="MyForm" /> 

I'd like reuse this include a.jsp in many pages.
How I can specify the "name" for this tag to be able reuse it?

tnx

Best Regards.
Michael.



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: [Q] how to get Form name in include JSP?

Posted by Kris Schneider <kr...@dotech.com>.
<html:text> is really only useful within <html:form>. So, presumably you've got
something like:

<html:form action="...">
  ...
  <% include file="a.jsp" %>
  ...
</html:form>

If a.jsp is just:

<html:text property="start"/>

Then its name attribute will default to the form associated with the action.
Maybe I'm missing something, but if you just drop the name attribute from
<html:text>, it should work.

Quoting Robert Taylor <rt...@mulework.com>:

> One solution would be to use a dynamic include instead of static.
> <jsp:include page="a.jsp">
> <jsp:param name="formName" value="MyForm"/>
> </jsp:include>
> 
> In a.jsp:
> 
> <html:text property="start" name="<%=request.getParameter("formName")%>"/>
> 
> 
> 
> robert
> 
> > -----Original Message-----
> > From: michael.korolyov@ps.ge.com [mailto:michael.korolyov@ps.ge.com]
> > Sent: Thursday, March 13, 2003 1:58 PM
> > To: struts-user@jakarta.apache.org
> > Subject: [Q] how to get Form name in include JSP?
> > 
> > 
> > Hello,
> > 
> > I have jsp include (<%include file="a.jsp"%>)
> > that has 
> > <html:text property="start" name="MyForm" /> 
> > 
> > I'd like reuse this include a.jsp in many pages.
> > How I can specify the "name" for this tag to be able reuse it?
> > 
> > tnx
> > 
> > Best Regards.
> > Michael.
> > 
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 


-- 
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: [Q] how to get Form name in include JSP?

Posted by Robert Taylor <rt...@mulework.com>.
One solution would be to use a dynamic include instead of static.
<jsp:include page="a.jsp">
<jsp:param name="formName" value="MyForm"/>
</jsp:include>

In a.jsp:

<html:text property="start" name="<%=request.getParameter("formName")%>"/>



robert

> -----Original Message-----
> From: michael.korolyov@ps.ge.com [mailto:michael.korolyov@ps.ge.com]
> Sent: Thursday, March 13, 2003 1:58 PM
> To: struts-user@jakarta.apache.org
> Subject: [Q] how to get Form name in include JSP?
> 
> 
> Hello,
> 
> I have jsp include (<%include file="a.jsp"%>)
> that has 
> <html:text property="start" name="MyForm" /> 
> 
> I'd like reuse this include a.jsp in many pages.
> How I can specify the "name" for this tag to be able reuse it?
> 
> tnx
> 
> Best Regards.
> Michael.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org