You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Stephen <sh...@pd.jaring.my> on 2002/06/02 10:41:30 UTC

Re: Need Help!!! Pls

Hi Mark!

Thanks for your suggestion to read the how to ask smart question!!

Indeed, this is the first time i submit question to this user-group and
don't really know to what extend i should elaborate on the problems.

The things i try to do is:

1. I have a class that extends struts PlugIn, in this class i initialize the
data source ( stored in JNDI filesystem context) and connection pooling
(store in servlet context) , and use Digester to read an XML file to create
javabean object and store the objects in servlet context.

2. Now in the JSP input page, i want some of the fields to be populated with
information that was previously store in servlet context. It is an array of
javabean.  in the JSP page i use the logic:iterate tag to populate the page.
To do this i created the ActionForm and action class
The client will point to the action class, in the excute method it will set
the action form with the array object take from servlet context then forward
to the jsp page.... eveytime when it run, the below exception will be
threw..  roughly this is the scenario and where i stuck...

hear from you all.......thx

Step


----- Original Message -----
From: "Galbreath, Mark" <Ga...@tessco.com>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Friday, May 31, 2002 3:45 AM
Subject: RE: Need Help!!! Pls


> Yes, there are a number of people here who can help.  No, we cannot
suggest
> a better way of doing what you are trying to do because you have not given
> us the slightest hint of how you are trying to accomplish your pre-visit
> form population.  I suspect that you are relying on Struts to magically
> populate a JavaBean which in turn would populate the field(s) of an HTML
> form prior to a client accessing the form.  Doesn't work that way.  The
> Struts "plugin" (I assume you mean the action class) must be activated by
a
> client request.  If you want a form to be dynamically populated with data
> prior to a client reaching it, the client must first request something
else
> (HTML, JSP or action class) that triggers the action class to populate the
> bean (by calling a DAO, VO, or other helper class that actually makes the
> database calls).  You could redirect to the action if you wanted to hide
> your implementation by the use of HTML meta refresh to trigger the action
> (<meta http-equiv='refresh' content='0; url=/do/myActionClass'>) or the <%
> jsp:forward %> tag, and the results would be displayed based on your
forward
> path in struts-config.
>
> You should also read:
> http://www.tuxedo.org/~esr/faqs/smart-questions.html
>
> Cheers (it's Friday)!
> Mark
>
> -----Original Message-----
> From: Shinyang [mailto:shinyang@pd.jaring.my]
> Sent: Friday, May 31, 2002 2:31 AM
> To: struts-user@jakarta.apache.org
> Subject: Need Help!!! Pls
>
>
> Hi,
>
> I am struts newbie!
>
> I develop an application to search a database. I have some problems that
> I fail to solve, before even connect to db.
>
> I do a search form. Before display the form, I need to populate some of
> the fields with java bean get from servlet context. The java bean in the
> servlet context was set through the struts plug-in.
>
> Now, I try to set the searchForm from searchAction, before display the
> search.jsp page, but every time failed. The following exception throws:
>
> Can anyone help!! Or recommend better approach to do this things. thx.
>
> javax.servlet.ServletException: No collection found
>         at
> org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContex
> tImpl.java:463)
>         at
> org.apache.jsp.searchRFQ$jsp._jspService(searchRFQ$jsp.java:553)
>         at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
> org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServle
> t.java:202)
>         at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
>         at
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc
> her.java:683)
>         at
> org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDisp
> atcher.java:431)
>         at
> org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispat
> cher.java:355)
>         at
> org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.jav
> a:972)
>         at
> org.apache.struts.action.RequestProcessor.processValidate(RequestProcess
> or.java:947)
>         at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
> 245)
>         at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1109)
>         at
> org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:452)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
> tionFilterChain.java:247)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
> erChain.java:193)
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
> e.java:243)
>         at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
> va:566)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
> 72)
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>         at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
> e.java:190)
>         at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
> va:566)
>         at
> org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.ja
> va:246)
>         at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
> va:564)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
> 72)
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>         at
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:234
> 3)
>         at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
> :180)
>         at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
> va:566)
>         at
> org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa
> lve.java:170)
>         at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
> va:564)
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
> :170)
>         at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
> va:564)
>         at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468
> )
>         at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
> va:564)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
> 72)
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>         at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
> java:174)
>         at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
> va:566)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
> 72)
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>         at
> org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.j
> ava:1012)
>         at
> org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:
> 1107)
>         at java.lang.Thread.run(Thread.java:536)
>
> Can you Java Guru out there.. pls help
>
> Step
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>