jsp rendering to session property for caching?
Hi all, wonder if you can help with ideas of how I can achieve this: I need to include two portions of html on every page - a tree structure which references layers that are included at another section of the page. Both of these sections will contain a lot of iteration and bean accesses and this does not change too often, so I would prefer to cache this information on the session. (of course the best thing to do is use frames, but we cannot do this for various reasons) What I would like to do is from the controller, process some view JSPs (that can access session beans) and store the returned html in the session object *before* forwarding onto pages which would write out these values onto the rendered page. something along these lines: RecreateTreeAction.perform(...) { // update the internal model request.getSession().setAttribute( "tree", RenderJsp("tree.jsp") ); request.getSession().setAttribute( "layers", RenderJsp("layers.jsp") ); return mapping.findForward("homepage"); } and in say, homepage.jsp: bean:write name="tree" .. whole bunch of other stuff .. bean:write name="layers" Any ideas people? Cheers Ned _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Re: using html:link to post a form ?
You can use javascript for this: html:link href="#" onclick="document.forms[0].submit(); return false;" img src="images/whatever.gif" border="0" /html:link And as per the suggestion Peter made to me the other day, use the same sort of call to modify the form action before posting if you're posting to different locations. --tom Justin Kennedy wrote: Hi all I've created a form like so: form:form name="users" action="users.do" focus="username" type="com.admin.forms.UsersForm" which contains a select box named 'username' I want to provide a link which will post the form. I've created UsersForm.java to validate, and it returns an error if username isn't selected. Everything works fine with: form:submit value="Add User"/ But I want to accomplish this with: html:link page="/users.do?action=AddUsr"Add User/html:link When I click on this link, it comes back to the same page with the error message I provided in UsersForm.validate() of "you must select a username", even though I've selected a username. So, by specifying users.do for page in html:link doesn't the controller servlet populate UsersForm with the request params and call validate ? It's obviously calling validate, but the bean properties seem like there not being set. The reason I want links instead of submit button is because I'm going to have multiple links that specify a different '?action=' so the target page can process accordingly Thanx, -Justin
Re: Couldn´t_install_at_bea´s_weblogic
hi, me to on weblogic(5.10) . All the examples I have tried get hung on the .tld file w/ the following exception: Parsing of JSP File '/struts3/index.jsp' failed: /struts3/index.jsp(2): Could not parse deployment descriptor: java.io.IOException: cannot resolve '/WEB-INF/struts-bean.tld' into a valid tag library probably occurred due to an error in /struts3/index.jsp line 2: %@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" % Thu Feb 01 20:07:38 PST 2001 any tips on this error appreciated. MikeD Original Message - From: "Wong Kok Wai" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 01, 2001 11:51 PM Subject: Re: Couldnt_install_at_beas_weblogic The first step is to check you're using SP8. The second step is to check whether struts.jar has been added to the Java or Weblogic classpath. If so, you must remove it from both these classpaths and just put struts.jar in the WEB-INF/lib directory and WebLogic will load the classes from there. --- Gustavo Hexsel [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hello, Im trying to use Struts with BEAs Weblogic, but cant even make the example work! Im having ClassCastException errors at the load() method at MessageTag; its probably some problem with the ClassLoaders, since the class is really a MessageResources. But there is only one copy of the application running and there is only one copy of the MessageResources installed. Heelp! Best regards, Quartz (Gustavo Hexsel, [EMAIL PROTECTED]) -BEGIN PGP SIGNATURE- Version: PGPfreeware 6.5.8 for non-commercial use http://www.pgp.com iQEVAwUBOnm2RRHqwb4rXhmVAQFsXwgAnxcsDE0ua+72/zd8mean0tKYnjXOplIl or9VZVsj3q+s2ch38KUQlwCs47UTxJjbBatNbu4cRvoHc8Q8av0R8Lun3BB5P7xP Wnq3Xua/hgHilEKT3iID1AOCgGL8Oc5QlQb63E+F0Yp9ok8j4231VgH7ARGdFXml Qbr/LMCb5832hNIFpH2qotgNtVTGP0sZV03bM4was73dUel1xf9UUndDX7yAoNtB J78APev6OJvg7x6SJ8CTBeDSj9neOVd6ESKrARE1A0RDw/PFTOF77EU/Tsbwm8VA HAUKFEmtWln6ilw094PverVIWjIAZN+2oQU5CfuUgOvhEp76tzzzEw== =Z/HZ -END PGP SIGNATURE- __ Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/
PROPOSAL: Struts Dreamweaver Integration
Hello, We (Compuware Amsterdam Lab) will start a project to integrate the Struts taglibs in MacroMedia Dreamweaver. It will become possible to edit JSP files with Struts tags using Dreamweaver, with all the advantages of a Web Authoring tool. We are planning to publish the Struts Dreamweaver extension to the Macromedia Dreamweaver site, hopefully somewhere in June this year. We will use the Struts .tld files as input for the extension module, so the extension module knows what tags and tag attributes to expect. Any help, ideas, and comments are welcome. Regards, Marjon Luites and Arjan Kok.
Re: Error: 500 from ????????????
I made thange the Mr Richard told me to do in the web.xml file, but still have the same problem, the same problem even with struts example. Always got this : Error: 500 Location: /hellostruts/hello.jsp Internal Servlet Error: javax.servlet.ServletException at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:399) at javax.servlet.http.HttpServlet.service(HttpServlet.java:865) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498) at java.lang.Thread.run(Thread.java:484) Root cause: java.lang.NoSuchMethodError at org.apache.jasper.compiler.TagLibraryInfoImpl.createAttribute(TagLibraryInfoImpl.java:524) at org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoImpl.java:432) at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:385) at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:233) at org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEventListener.java:706) at org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingListener.java:116) at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:215) at org.apache.jasper.compiler.Parser.parse(Parser.java:1077) at org.apache.jasper.compiler.Parser.parse(Parser.java:1042) at org.apache.jasper.compiler.Parser.parse(Parser.java:1038) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:182) at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:462) at org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146) at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:433) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:152) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:164) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391) at javax.servlet.http.HttpServlet.service(HttpServlet.java:865) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498) at java.lang.Thread.run(Thread.java:484) -- majid kamal [EMAIL PROTECTED] - email (781) 685-1450 x2371 - voicemail/fax "Steven D. Wilkinson" [EMAIL PROTECTED] wrote: As Richard mentioned your xml is wrong. Try this... I assume you have the header information or else it would be a different error.;-) ?xml version="1.0" encoding="ISO-8859-1"? !DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd" web-app servlet servlet-nameaction/servlet-name servlet-classorg.apache.struts.action.ActionServlet/servlet-class !--Below is the init-param-- !--This defines where your application resources are located.-- !--It uses the classloader to find the file.-- !--The ".properties" extension isn´t used to locate resources.-- init-param param-nameapplication/param-name param-valuehelloworld.HelloWorldResources/param-value /init-param load-on-startup1/load-on-startup /servlet !--This section defines what file to open first if none is specified -- welcome-file-list welcome-filehello.jsp/welcome-file /welcome-file-list !--The following section defines a URI to use to retrieve the struts taglib -- taglib taglib-uri/WEB-INF/struts-bean.tld/taglib-uri taglib-location/WEB-INF/struts-bean.tld/taglib-location /taglib /web-app Notice, that
Running and debugging with Oracle JDeveloper
Hello, has anyone successfully achieved to run/debug a web application based on struts using Oracle JDeveloper 3.2.2? If I run/debug my application I get the following error message: javax.servlet.jsp.JspException: Missing resources attribute org.apache.struts.action.MESSAGE void index._jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) void oracle.jsp.runtime.HttpJsp.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) void oracle.jsp.app.JspApplication.dispatchRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) void oracle.jsp.JspServlet.doDispatch(oracle.jsp.app.JspRequestContext) void oracle.jsp.JspServlet.internalService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) void oracle.jsp.JspServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) void oracle.lite.web.JupServlet.service(oracle.lite.web.JupRequest, oracle.lite.web.JupResponse) void oracle.lite.web.MimeServletHandler.handle(oracle.lite.web.JupApplication, java.lang.String, int, oracle.lite.web.JupRequest, oracle.lite.web.JupResponse) void oracle.lite.web.JupApplication.service(oracle.lite.web.JupRequest, oracle.lite.web.JupResponse) void oracle.lite.web.JupHandler.handle(oracle.lite.web.JupRequest, oracle.lite.web.JupResponse) void oracle.lite.web.HTTPServer.process(oracle.lite.web.JupRequest, oracle.lite.web.JupResponse) boolean oracle.lite.web.HTTPServer.handleRequest(oracle.lite.web.JupInputStream, oracle.lite.web.JupOutputStream) boolean oracle.lite.web.JupServer.handle(oracle.lite.web.JupInputStream, oracle.lite.web.JupOutputStream) void oracle.lite.web.SocketListener.process(java.net.Socket) void oracle.lite.web.SocketListener$ReqHandler.run() Any help would be appreciated. Regards, Michael
Can I have error messages replace other messages?
Hi, (I'm new to Struts and...) I'm wondering if there's a way to have an error message (e.g. html:errors...) replace the "normal" message. For example: I have a logon page with 2 fields (usr pwd) and the messages "user name:" and "password:" in front of the fields. If the user forgets to enter a password I'd like to replace "password:" with "You have to enter a password!" or something... Is it possible? Thanks, Erik Dworog
can %25 be in query string parameter name?
javax.servlet.jsp.JspException at org.apache.struts.taglib.template.InsertTag.doEndTag(InsertTag.java:133) at _0002fhome_0002ejsphome_jsp_0._jspService(_0002fhome_0002ejsphome_jsp_0.java:106) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:174) at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:268) at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:381) at com.broadvision.commerce.servlet.MRJspServlet.service(MRJspServlet.java:98) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.broadvision.servlet.ServletContainer.service(ServletContainer.java:209) at com.broadvision.servlet.BVRequestDispatcher.forward(BVRequestDispatcher.java:130) at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1479) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1338) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:430) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.broadvision.servlet.ServletContainer.service(ServletContainer.java:209) at com.broadvision.servlet.ServletContainer.processRequest(ServletContainer.java:166) at com.broadvision.servlet.ServletContextContainer.processRequest(ServletContextContainer.java:503) at com.broadvision.servlet.BVServletEngine.service(BVServletEngine.java:201) at com.broadvision.servlet.BVServletConnector.service(BVServletConnector.java:96) Do You Yahoo!? - Get personalized email addresses from Yahoo! Mail Personal Address - only $35 a year!
can %25 be in query string parameter name?
Hi, I am really sorry for my previous Email. I didn't put my question there. Thanks! I have a query string which has a parameter named as: file%name. So after URL encoding, it is encoded as: file%25name. And I found it will break strus action class. It gives me the following error: javax.servlet.jsp.JspException at org.apache.struts.taglib.template.InsertTag.doEndTag(InsertTag.java:133) at _0002fhome_0002ejsphome_jsp_0._jspService(_0002fhome_0002ejsphome_jsp_0.java:106) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:174) at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:268) at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:381) at com.broadvision.commerce.servlet.MRJspServlet.service(MRJspServlet.java:98) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.broadvision.servlet.ServletContainer.service(ServletContainer.java:209) at com.broadvision.servlet.BVRequestDispatcher.forward(BVRequestDispatcher.java:130) at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1479) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1338) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:430) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.broadvision.servlet.ServletContainer.service(ServletContainer.java:209) at com.broadvision.servlet.ServletContainer.processRequest(ServletContainer.java:166) at com.broadvision.servlet.ServletContextContainer.processRequest(ServletContextContainer.java:503) at com.broadvision.servlet.BVServletEngine.service(BVServletEngine.java:201) at com.broadvision.servlet.BVServletConnector.service(BVServletConnector.java:96) Could anybody tell me where the problem comes from? And any suggestions? Thanks! Xin Liu Do You Yahoo!? - Get personalized email addresses from Yahoo! Mail Personal Address - only $35 a year!
RE: Running and debugging with Oracle JDeveloper
I recently had this problem and it was due to the "application" parameter option in the web.xml file not pointing to a valid resource file -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, February 02, 2001 10:40 AM To: [EMAIL PROTECTED] Subject: Running and debugging with Oracle JDeveloper Hello, has anyone successfully achieved to run/debug a web application based on struts using Oracle JDeveloper 3.2.2? If I run/debug my application I get the following error message: javax.servlet.jsp.JspException: Missing resources attribute org.apache.struts.action.MESSAGE void index._jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) void oracle.jsp.runtime.HttpJsp.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) void oracle.jsp.app.JspApplication.dispatchRequest(javax.servlet.http.HttpServlet Request, javax.servlet.http.HttpServletResponse) void oracle.jsp.JspServlet.doDispatch(oracle.jsp.app.JspRequestContext) void oracle.jsp.JspServlet.internalService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) void oracle.jsp.JspServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) void oracle.lite.web.JupServlet.service(oracle.lite.web.JupRequest, oracle.lite.web.JupResponse) void oracle.lite.web.MimeServletHandler.handle(oracle.lite.web.JupApplication, java.lang.String, int, oracle.lite.web.JupRequest, oracle.lite.web.JupResponse) void oracle.lite.web.JupApplication.service(oracle.lite.web.JupRequest, oracle.lite.web.JupResponse) void oracle.lite.web.JupHandler.handle(oracle.lite.web.JupRequest, oracle.lite.web.JupResponse) void oracle.lite.web.HTTPServer.process(oracle.lite.web.JupRequest, oracle.lite.web.JupResponse) boolean oracle.lite.web.HTTPServer.handleRequest(oracle.lite.web.JupInputStream, oracle.lite.web.JupOutputStream) boolean oracle.lite.web.JupServer.handle(oracle.lite.web.JupInputStream, oracle.lite.web.JupOutputStream) void oracle.lite.web.SocketListener.process(java.net.Socket) void oracle.lite.web.SocketListener$ReqHandler.run() Any help would be appreciated. Regards, Michael
define tag
Hi If we use struts-bean:define tag and if the variable is not found, does it raise exception. If yes how can I catch it and handle it. Normally if A is in Sesion scope and a property B then we would do bean:define id="m" name="A" scope="session" type="typeA" / bean:define id="B" name="m" scope="page" type="typeB" / Now if for some reason we cant find A in the session or say A is null, we cant put a series of if conditions in the jsp. How are we supposed to handle such scenarios Thanks Hunt __ Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/
RE: can a ActionForm be ever null in Action class
Hi All Just a thought, but couldn't we use the Null Object pattern (pp 365-369, Patterns in Java Volume 1, Mark Grand) as a default for this scenario? It would mean that there would be no further need to make an explicit test for null, as calling the corresponding method will have no effect. As I said, just a thought. In any case, keep up the brilliant work. Cheers, Philip Hart -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: 02 February 2001 17:42 To: [EMAIL PROTECTED] Subject: Re: can a ActionForm be ever null in Action class Anand Raman wrote: Hi guys I noticed in the struts-example application a check to find whether the ActionForm "form" passed to the perform method of Action class is null or not. Is it really necesarry.. I am not able to come up with a situation like this.. According my knowldge a ActionForm is always populated before the perform method is called on the Action class.. can anyone please enlighten this situation It will be null if and only if you have not associated an input form with this action. Otherwise, an ActionForm will have been created and populated if it didn't already exist. Now, of course, since I wrote the entire app in this case, I *know* that the configuration file is correct, and the null checks are not strictly necessary. On the other hand, if I was writing actions and someone else was building struts-config.xml, I'd generally do a little defensive coding like this to protect myself from configuration file mistakes ... Thanks for ur time Anand Craig
Re: define tag
OK, lame-brain is back again. Here's the example I was looking for. -- %@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" % %@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" % HTML logic:present name="guava"bean:define id="cool" name="guava"//logic:present BODY P logic:present name="cool"bean:write name="cool" property="name"//logic:present logic:notPresent name="cool"Ooops/logic:notPresent /P /BODY /HTML -- Also note that logic:present / notPresent can be told which scope to check, if that's important. *** REPLY SEPARATOR *** On 2/2/2001 at 11:46 AM John Hunt wrote: Hi If we use struts-bean:define tag and if the variable is not found, does it raise exception. If yes how can I catch it and handle it. Normally if A is in Sesion scope and a property B then we would do bean:define id="m" name="A" scope="session" type="typeA" / bean:define id="B" name="m" scope="page" type="typeB" / Now if for some reason we cant find A in the session or say A is null, we cant put a series of if conditions in the jsp. How are we supposed to handle such scenarios Thanks Hunt -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 425-0252; Fax 716 223-2506. -- http://www.husted.com/about/struts/
RE: Problem with nightly build- property 'lowsrc'
Bob, I'm using weblogic, and I'm seeing this problem, too. Any luck finding a workaround? Thanks, quoc -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, January 29, 2001 2:07 PM To: [EMAIL PROTECTED] Subject: Problem with nightly build- property 'lowsrc' The example app will no longer run on Weblogic 5.1. It worked with the last build I downloaded (01-23). Has anyone else encountered this error- or is this specific to WL? Thanks, Bob Parsing of JSP File '/index.jsp' failed: /index.jsp(-1): Error in tag library at: 'html': There is no setter method for property 'lowsrc', for Tag class 'org.apache.struts.taglib.html.ImgTag' probably occurred due to an error in /index.jsp line -1: Mon Jan 29 16:58:11 EST 2001 Mon Jan 29 16:58:10 EST 2001:I WebAppServletContext-strutsexample resolving taglib uri '/WEB-INF/struts-bean.tld' to taglib-location /WEB-INF/struts-bean.tld: Mon Jan 29 16:58:10 EST 2001:I WebAppServletContext-strutsexample resolving taglib uri '/WEB-INF/struts-html.tld' to taglib-location /WEB-INF/struts-html.tld: Mon Jan 29 16:58:11 EST 2001:E WebAppServletContext-strutsexample Servlet failed with Exception weblogic.servlet.jsp.JspException: (line -1): Error in tag library at: 'html': There is no setter method for property 'lowsrc', for Tag class 'org.apache.struts.tagli b.html.ImgTag' at weblogic.servlet.jsp.StandardTagLib.jspException(StandardTagLib.java:138) at weblogic.servlet.jsp.StandardTagLib.processTag(StandardTagLib.java, Compiled Code) at weblogic.servlet.jsp.StandardTagLib.processTagElements(StandardTagLib.java, Compiled Code) at weblogic.servlet.jsp.StandardTagLib.init(StandardTagLib.java:125) at weblogic.servlet.jsp.JspLexer.loadTagLib(JspLexer.java:87) at weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE_BODY(JspLexer.java, Compiled Code) at weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE(JspLexer.java, Compiled Code) at weblogic.servlet.jsp.JspLexer.mDIRECTIVE(JspLexer.java, Compiled Code) at weblogic.servlet.jsp.JspLexer.mSTANDARD_THING(JspLexer.java:1760) at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:1601) at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java, Compiled Code) at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java, Compiled Code) at weblogic.servlet.jsp.JspParser.doit(JspParser.java, Compiled Code) at weblogic.servlet.jsp.JspParser.parse(JspParser.java:116) at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:97) at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java, Compiled Code) at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java, Compiled Code) at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:217) at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:16 4) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java :101) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java :124) at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp l.java:907) at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp l.java:851) at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext Manager.java:252) at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:364) at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:252) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
Re: member variables
There is a single action object per session. You do need to take care of any concurrency issues. The use of instance variables where possible is recommended. See http://jakarta.apache.org/struts/userGuide/building_controller.html#acti on_classes for more, starting with "Design issues to remember when coding Action classes". *** REPLY SEPARATOR *** On 2/2/2001 at 3:54 PM John Hunt wrote: What are the ramifications of having member variables in action class ( should we take care of any concurrency issues )... Does every request create a new Action object or these objects reused Thanks Hunt __ Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 425-0252; Fax 716 223-2506. -- http://www.husted.com/about/struts/
RE: member variables
You mean one instance of each Action class per application, not session. I would say that the use of instance variables is discouraged because they raise synchronization issues. "The most important principle that aids in thread-safe coding is to use only local variables, not instance variables, in your Action class. Local variables are created on a stack that is assigned (by your JVM) to each request thread, so there is no need to worry about sharing them. " Hal -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED]] Sent: Friday, February 02, 2001 7:00 PM To: Struts List Subject: Re: member variables There is a single action object per session. You do need to take care of any concurrency issues. The use of instance variables where possible is recommended. See http://jakarta.apache.org/struts/userGuide/building_controller.html#acti on_classes for more, starting with "Design issues to remember when coding Action classes". *** REPLY SEPARATOR *** On 2/2/2001 at 3:54 PM John Hunt wrote: What are the ramifications of having member variables in action class ( should we take care of any concurrency issues )... Does every request create a new Action object or these objects reused Thanks Hunt __ Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 425-0252; Fax 716 223-2506. -- http://www.husted.com/about/struts/
Re: member variables
Ted Husted wrote: There is a single action object per session. Um, actually it is per *application*, not per *session*. All users who call the same action URI are sharing the same action instance. The primary implication of this is that instance variables in your action classes are shared across all requests, while local variables (inside the perform() method) is not shared. Craig McClanahan
gefion web server with struts.
Hello, I am new to struts and was trying to get one of the examples working. I seem to be getting quite a few errors (some of which I could fix), but after re-reading thru some of the documentation on my web server I found this (I am using the gefion lws web server www.gefionsoftware.com): Known limitations of the gefion light web server: Does not support the Web Application directory structure and Web Application Archive File format. Is this my problem or do I just need to spend some more time configuring the locations of file(s) with respect to my web server (cannot change web servers to apache or any other web server- our projects are dependent upon gefion lws)? Thanks, Jason
Problems running struts-example
I grabbed the latest nightly build, dropped struts-example.war in the webapps dir, but when I try to run it I get this error: Missing message for key index.title ... javax.servlet.jsp.JspException: Missing message for key index.title at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:261) ... I noticed quite a few threads on this, but most pertaining to the Orion server but I'm using Tomcat. The properties file it is looking for in web.xml does exist, and there is indeed an entry for index.title. Everything else works fine.. my struts application/struts-documentation/etc.. any suggestions ? thanx -Justin
[ANNOUNCEMENT] New Bug Tracking System
All of the Jakarta projects, including Struts, have recently migrated to use a BugZilla installation, which you can reach at: http://nagoya.apache.org/bugzilla All existing opened bugs that had been entered in BugRat have been forwarded automatically, but all new bugs should be entered at the address above. I will be updating the Struts web site information about this shortly. Committers, I would in particular like you to create yourselves Bugzilla accounts so that bugs can be assigned to you :-). In addition, if you would like to be the default assignee for bugs in a certain category, please let me know. Craig McClanahan
Re: ActionForward: scope of modifications?
Yes, that is correct. It wouldn't hurt to document it, I guess. As far as cloning or copying is concerned, is there a real need to do that? I find the most common pattern that I use for modifying ActionForward's is when I do something like: return new ActionForward(myPath, myRedirect); Rather than cloning and modifying, I just create a new one with the parameters I need. Yes, sometimes one or other parameter comes from an existing ActionForward, but to me that still seems easier than cloning and modifying. Hope this helps. -- Martin Cooper Tumbleweed Communications - Original Message - From: "John Raley" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, January 31, 2001 12:31 PM Subject: ActionForward: scope of modifications? I didn't do a thorough walk through the source, but it appears that if I modify an ActionForward returned from an ActionMapping passed to Action.perform I am changing global state in struts. Is this correct? If so, I think this should be in the javadoc for ActionMapping, and ActionForward should be cloneable or have a copy constructor. Thanks, John