You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by bj...@accenture.com on 2007/02/05 17:21:24 UTC

Extend form-bean in struts-config

Hi

In my struts config, I have a few forms, with type DynaValidatorForm.  The problem is, I have a few forms who share a few fields.  Is there a way to declare a superform and let the other extend that form, so that I don't have to declare the common fields for every form?

Tia

Bjorn De Bakker

 



This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information.  If you have received it in error, please notify the sender immediately and delete the original.  Any other use of the email by you is prohibited.

RE: Using DispatchAction and Struts Tiles

Posted by Joe Yuen <jo...@chisq.com>.
Here's the rest of the stack trace:
 
ServletException in '/tiles/VitalsMainInput.jsp': ServletException in '/tiles/VitalsMainInput.jsp': ServletException in '/tiles/VitalsMainInput.jsp': Servlet execution threw an exception
 at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:923)
 at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:462)
 at org.apache.jsp.tiles.template_jsp._jspx_meth_tiles_insert_3(template_jsp.java:211)
 at org.apache.jsp.tiles.template_jsp._jspService(template_jsp.java:103)
 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
 at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
 at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
 at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
 at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
 at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
 at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
 at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:239)
 at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:302)
 at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
 at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
 at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
 at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
 at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
 at java.lang.Thread.run(Unknown Source)

 
Any idea of what might be wrong?
 
Thanks.

________________________________

From: Dave Newton [mailto:newton.dave@yahoo.com]
Sent: Tue 2/6/2007 10:17 AM
To: Struts Users Mailing List
Subject: RE: Using DispatchAction and Struts Tiles



--- Joe Yuen <jo...@chisq.com> wrote:
> So would this be a valid definition?

Oh, I didn't know you meant as a Tiles controller.

Still, I don't know why not.

> '/tiles/VitalsMainInput.jsp': ServletException in
> '/tiles/VitalsMainInput.jsp': Servlet execution
> threw an exception
>  at
>
org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:923)
>  at
>
org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:462)
> 
> ....so on

The "....so on" part is probably helpful.

d.




____________________________________________________________________________________
It's here! Your new message! 
Get new email alerts with the free Yahoo! Toolbar.
http://tools.search.yahoo.com/toolbar/features/mail/

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





RE: Using DispatchAction and Struts Tiles

Posted by Dave Newton <ne...@yahoo.com>.
--- Joe Yuen <jo...@chisq.com> wrote:
> So would this be a valid definition?

Oh, I didn't know you meant as a Tiles controller.

Still, I don't know why not.

> '/tiles/VitalsMainInput.jsp': ServletException in
> '/tiles/VitalsMainInput.jsp': Servlet execution
> threw an exception
>  at
>
org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:923)
>  at
>
org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:462)
>  
> ....so on

The "....so on" part is probably helpful.

d.



 
____________________________________________________________________________________
It's here! Your new message!  
Get new email alerts with the free Yahoo! Toolbar.
http://tools.search.yahoo.com/toolbar/features/mail/

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


RE: Using DispatchAction and Struts Tiles

Posted by Joe Yuen <jo...@chisq.com>.
So would this be a valid definition?
 
<definition name="VitalSigns.Input" 

          path ="/tiles/VitalsMainInput.jsp"

         controllerUrl= "/VitalSigns.do?action=edit" >

</definition>

where edit is method in VitalSignsAction and action is the parameter in my action mapping. It doesn't seem to work for me. I get this error:
 
'/tiles/VitalsMainInput.jsp': ServletException in '/tiles/VitalsMainInput.jsp': Servlet execution threw an exception
 at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:923)
 at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:462)
 
....so on
 

 
________________________________

From: Dave Newton [mailto:newton.dave@yahoo.com]
Sent: Mon 2/5/2007 4:40 PM
To: Struts Users Mailing List
Subject: Re: Using DispatchAction and Struts Tiles



--- Joe Yuen <jo...@chisq.com> wrote:
> Does anyone know if these two can somehow be used
> together?

Sure, why not?

Dave




____________________________________________________________________________________
Have a burning question? 
Go to www.Answers.yahoo.com and get answers from real people who know.

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





Re: Using DispatchAction and Struts Tiles

Posted by Dave Newton <ne...@yahoo.com>.
--- Joe Yuen <jo...@chisq.com> wrote:
> Does anyone know if these two can somehow be used
> together?

Sure, why not?

Dave



 
____________________________________________________________________________________
Have a burning question?  
Go to www.Answers.yahoo.com and get answers from real people who know.

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


Using DispatchAction and Struts Tiles

Posted by Joe Yuen <jo...@chisq.com>.
Does anyone know if these two can somehow be used together?


Re: Extend form-bean in struts-config

Posted by Laurie Harper <la...@holoweb.net>.
bjorn.de.bakker@accenture.com wrote:
> Hi
> 
> In my struts config, I have a few forms, with type DynaValidatorForm.  The problem is, I have a few forms who share a few fields.  Is there a way to declare a superform and let the other extend that form, so that I don't have to declare the common fields for every form?


Yes, using the 'extends' attribute. Something like:

<form-beans>
   <form-bean name="base" type="...DynaValidatorForm">
     <form-property name="value1"/>
     <form-property name="value2"/>
     ...
   </form-bean>
   <form-bean name="form1" extends="base">
     ...
   </form-bean>
</form-bean>

Note, this is a relatively recent feature in Struts 1, so you may need 
to upgrade to take advantage of it (I believe it was introduced in the 
1.3 series).

L.


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