RE: POSTing arrays in struts
Do you ( or anyone) know if this is a known bug? To: '[EMAIL PROTECTED]' Taylor, [EMAIL PROTECTED] Jeremy cc: (bcc: Will Spies/Towers Perrin) jtaylor@lehmSubject: RE: POSTing arrays in struts an.COM 04/09/01 11:31 AM Please respond to struts-user It could, but it doesnt. Why not fix the Util class so that it does then submit it back to the commiters? -Original Message- From: Will Spies/Towers Perrin [SMTP:[EMAIL PROTECTED]] Sent: 09 April 2001 16:13 To: [EMAIL PROTECTED] Cc: '[EMAIL PROTECTED]' Subject: RE: POSTing arrays in struts I don't really understand why I have to do this. That's a lot of code to write too. The JSP code that I have below actually works on the read. Struts handles it fine and I see the actual data sitting in the input control when the form comes up in my browser. If struts can do that, I can't see why struts can't go the other way and match it up on a post so my form' already has the data way before the 'perform' method is called. To: '[EMAIL PROTECTED]' Taylor, [EMAIL PROTECTED] Jeremy cc: (bcc: Will Spies/Towers Perrin) jtaylor@lehmSubject: RE: POSTing arrays in struts an.COM 04/09/01 11:04 AM Please respond to struts-user If all your input fields have the same name then when the form is submitted there will be a in your Action class there will be a method perform has takes a parameter HttpServletRequest request, so, rather than doing PropertyUtils.copyProperties(user, form); do something like String[] rows = request.getParameterValues(InputFieldName); form.setRows(rows); -Original Message- From: Will Spies/Towers Perrin [SMTP:[EMAIL PROTECTED]] Sent: 09 April 2001 15:41 To: [EMAIL PROTECTED] Cc: '[EMAIL PROTECTED]' Subject: RE: POSTing arrays in struts Ok. Now we are talking. Q1: My save action class DOES work like the example. It gets the form and expects the ActionServlet to fill it up. By the time I get the form, the ActionServlet is done with it? How would I change this to work properly or do I need a new version of the util class? Q2: I was under the impression the html:text tags did not work properly inside an iterate tag. To: '[EMAIL PROTECTED]' Taylor, [EMAIL PROTECTED] Jeremy cc: (bcc: Will Spies/Towers Perrin) jtaylor@lehmSubject: RE: POSTing arrays in struts an.COM 04/09/01 10:32 AM Please respond to struts-user You don't need to generate index properties for the input tags. Also, how does your save action class work? If you based it on the struts examples you'll need to change it because the util class that copies bean properties won't work with the array of values for the rows property. -Original Message- From: Will Spies/Towers
Struts samples on iPlanet 6.0 sp2 - newbie quesion
Has anyone deployed the Struts samples on iPlanet 6.0 sp2 successfully? I keep getting a GX Error (GX2GX) socket result code missing!!! whenever I try to run any struts application. However I tried deploying the HelloWorld example of iPlanet and it works just fine. Thanks for the help.
Struts with J2EE RI - Custom tags problems
Hi, I tried to integrate Struts into the J2EE ref implementation (v1.2.1) this week-end but I found an annoying bug : It seems there's no support for tag libraries in the deploytool, as I can't find where to define mappings between taglib URIs and taglib locations. Has anyone faced and resolved this problem ? Thank you. Olivier.
Bundle attribute for bean:message tag???
Hi all, I'm wanting to use the bean:message.../ tag in an application where I'm not using the ActionServlet and therefore, not setting up the servlet specs in my web.xml file. Currently when the JSP page executes the bean:message.../ tag it tells me: javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE I thought I could fix the problem by specifying the bundle attribute of the MessageTag class and setting it to the location in my CLASSPATH where the properties file resides but it still doesn't find the file. I have specified the file with a .properties extension and double-checked that it is in my CLASSPATH at the specified location with the name ApplicationResources.properties. Any ideas? Anyone run into this before? I did search the messages I have stored as well as scoured the Struts website but couldn't find anything on this matter so I hope I'm not repeating something that was dealt with previously. thanks in advance, Darryl
NoSuchMethodError deploying Struts on Windows 95
I've successfully deployed/developing using Struts on an NT machine at work, but have run into a 'simple' problem installing Struts at home on Windows 95. Placing the struts-example WAR in my webapp directory causes Tomcat not to start, with the error being reported as method getServletName() not found. I'm definitely using an up to date version of servlet.jar, and have tried the obvious, like searching out and removing old copies of servlet.jar, but can't seem to nail this one and am even starting to look for the 'red herring' in all this. I've tried loading my latest servlet.jar under tomcat\lib (successfully picked up by tomcat.bat), jdk1.2.2\lib, SERVLETAPI_HOME, and even placing the jar files on my CLASSPATH, as below... From stack trace: .../removeForward, type=org.apache.struts.actions.RemoveForwardAction]) Pop org.apache.struts.action.ActionMapping New org.apache.struts.action.ActionMapping Set org.apache.struts.action.ActionMapping properties Call org.apache.struts.action.ActionServlet.addMapping(ActionMapping[path=/admin /removeMapping, type=org.apache.struts.actions.RemoveMappingAction]) Pop org.apache.struts.action.ActionMapping Exception in thread "main" java.lang.NoSuchMethodError: javax.servlet.ServletCon fig: method getServletName()Ljava/lang/String; not found at org.apache.struts.action.ActionServlet.initServlet(ActionServlet.java , Compiled Code) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:473) at javax.servlet.GenericServlet.init(GenericServlet.java:266) at org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317) at org.apache.tomcat.core.Handler.init(Handler.java:215) at org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:296) at org.apache.tomcat.context.LoadOnStartupInterceptor.contextInit(LoadOn StartupInterceptor.java, Compiled Code) at org.apache.tomcat.core.ContextManager.initContext(ContextManager.java , Compiled Code) at org.apache.tomcat.core.ContextManager.init(ContextManager.java, Compi led Code) at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:195) at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235) Environment Details: --- Windows 95 JDK1.2.2 Tomcat 3.2.1 autoexec.bat: ... path=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\jdk1.2.2\bin;D:\struts\ant\src\antidot e\bin;C:\ORACLE\BIN; set CLASSPATH=C:\jdk1.2.2\lib\tools.jar;C:\jdk1.2.2\lib\servlet.jar;C:\jdk1.2.2\ lib\parser.jar;C:\jdk1.2.2\lib\jaxp.jar; set JAVA_HOME=C:\jdk1.2.2 set TOMCAT_HOME=D:\jakarta\tomcat set SERVLETAPI_HOME=D:\jakarta\servletapi Any suggestions...??? Cheers, - Chris --- Christopher Nuttall Software Engineer - Unified Messaging InterVoice-Brite Tel: Fax: Email: [EMAIL PROTECTED] ---
RE: servlet context attribute?
You can refer the "Service Locator" pattern that Sun has come up with for implementing Singleton instance. It is part of Sun's J2EE Pattern catalog. But I am not sure whether remote clients would be able to access this instance directly, unless you bind it explicitly to JNDI. Any comments? -Original Message- From: Jim Richards [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 07, 2001 9:01 PM To: [EMAIL PROTECTED] Subject: Re: servlet context attribute? "Young, Wayne" wrote: Ok, that gets me closer. I created the servlet put the following code in the init() method. // Store the lookup service in the servlet context LookupService lookupService = new LookupService(); getServletContext().setAttribute("LookupService",lookupService); I need to get access to this attribute in a class that has nothing to do with servlets. Is there a method call I can make? Not really no, you might want to look up the definition of the single design pattern. I don't have the references here, but the basic idea is to not create the object as you done about but have LookupService lookupService = LookupService.getInstance(); and then public class LookupService { private static LookupService instance = null; public LookupService getInstance() { if (instance == null) instance = new LookupService(); return instance; } } so you can grab the objcet any where and be assured there is only one instance that you are sharing. You of course then need to make sure that the methods are synchroni(s|z)ed.
Resources.properties - trick?
Hi, is there a trick using a "Resource.properties"-file. I'm creating a "Resource.properties"-file in WEB-INF/classes folder of my application. The web.xml looks like: ... init-param param-nameapplication/param-name param-valueResources/param-value /init-param ... In the JSP-file the bean:message-Tag is: bean:message key="index.benutzername"/ By running the application an error displays The Error is: A Servlet Exception Has Occurred Exception Report: javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextIm pl.java:481) at _0002findex_0002ejspindex_jsp_161._jspService(_0002findex_0002ejspindex_jsp _161.java:513) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.j ava:184) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:328) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:407) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC hain.java:215) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j ava:251) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.j ava:196) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java: 242) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2041) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:16 1) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:225 ) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.jav a:159) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java :818) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:897 ) at java.lang.Thread.run(Thread.java:484) Root Cause: javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE at org.apache.struts.util.RequestUtils.message(RequestUtils.java:285) at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:239) at _0002findex_0002ejspindex_jsp_161._jspService(_0002findex_0002ejspindex_jsp _161.java:168) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.j ava:184) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:328) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:407) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC hain.java:215) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j ava:251) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.j ava:196) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java: 242) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2041) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:16 1) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:225 ) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.jav a:159) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java :818) at
Re: Resources.properties - trick?
Michael, Looks like you're asking basically the same thing I was asking in my note titled: "Bundle attribute for bean:message tag???" The reason you're getting that error is that the MessageResources object has not been initialized and placed in the session (page?) context under the key "org.apache.struts.action.MESSAGE". It seems like you have to actually use the ActionServlet to get this to happen. There's probably a way that one can hack around this and instantiate it programatically at startup but I was hoping there was some way Struts can do this already without me having to do a hack solution. Hopefully someone in the group will respond to our problem. thanks, Darryl Michael Schommer wrote: Hi, is there a trick using a "Resource.properties"-file. I'm creating a "Resource.properties"-file in WEB-INF/classes folder of my application. The web.xml looks like: ... init-param param-nameapplication/param-name param-valueResources/param-value /init-param ... In the JSP-file the bean:message-Tag is: bean:message key="index.benutzername"/ By running the application an error displays The Error is: A Servlet Exception Has Occurred Exception Report: javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextIm pl.java:481) at _0002findex_0002ejspindex_jsp_161._jspService(_0002findex_0002ejspindex_jsp _161.java:513) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.j ava:184) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:328) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:407) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC hain.java:215) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j ava:251) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.j ava:196) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java: 242) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2041) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:16 1) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:225 ) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.jav a:159) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java :818) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:897 ) at java.lang.Thread.run(Thread.java:484) Root Cause: javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE at org.apache.struts.util.RequestUtils.message(RequestUtils.java:285) at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:239) at _0002findex_0002ejspindex_jsp_161._jspService(_0002findex_0002ejspindex_jsp _161.java:168) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.j ava:184) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:328) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:407) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC hain.java:215) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j ava:251) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.j ava:196) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java: 242) at
RE: Resources.properties - trick?
Is your ResourceBundle called "Resources.properties" or "Resource.properties"? Your mail implies a mis-match. Also, I assume your init-param is for the Struts Action Servlet. Mark -Original Message- From: Michael Schommer [mailto:[EMAIL PROTECTED]] Sent: 09 April 2001 12:57 To: [EMAIL PROTECTED] Subject: Resources.properties - trick? Hi, is there a trick using a "Resource.properties"-file. I'm creating a "Resource.properties"-file in WEB-INF/classes folder of my application. The web.xml looks like: ... init-param param-nameapplication/param-name param-valueResources/param-value /init-param ... In the JSP-file the bean:message-Tag is: bean:message key="index.benutzername"/ By running the application an error displays The Error is: A Servlet Exception Has Occurred Exception Report: javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextIm pl.java:481) at _0002findex_0002ejspindex_jsp_161._jspService(_0002findex_0002ejspindex_jsp _161.java:513) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.j ava:184) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:328) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:407) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC hain.java:215) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j ava:251) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.j ava:196) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java: 242) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2041) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:16 1) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:225 ) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.jav a:159) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java :818) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:897 ) at java.lang.Thread.run(Thread.java:484) Root Cause: javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE at org.apache.struts.util.RequestUtils.message(RequestUtils.java:285) at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:239) at _0002findex_0002ejspindex_jsp_161._jspService(_0002findex_0002ejspindex_jsp _161.java:168) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.j ava:184) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:328) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:407) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC hain.java:215) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j ava:251) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.j ava:196) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java: 242) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2041) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:16 1) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:225 ) at
Re: Resources.properties - trick?
Michael, Sorry, it looks like I've responded too quickly to your note. I must have been asleep when I read your note to have missed that you were using init-params. I apologize for the misstep. I think Mark has probably identified your problem correctly. Mark, any idea how to use a MessageResource file WITHOUT having to use ActionServlet. thanks, Darryl "Geddes, Mark (ANTS)" wrote: Is your ResourceBundle called "Resources.properties" or "Resource.properties"? Your mail implies a mis-match. Also, I assume your init-param is for the Struts Action Servlet. Mark -Original Message- From: Michael Schommer [mailto:[EMAIL PROTECTED]] Sent: 09 April 2001 12:57 To: [EMAIL PROTECTED] Subject: Resources.properties - trick? Hi, is there a trick using a "Resource.properties"-file. I'm creating a "Resource.properties"-file in WEB-INF/classes folder of my application. The web.xml looks like: ... init-param param-nameapplication/param-name param-valueResources/param-value /init-param ... In the JSP-file the bean:message-Tag is: bean:message key="index.benutzername"/ By running the application an error displays The Error is: A Servlet Exception Has Occurred Exception Report: javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextIm pl.java:481) at _0002findex_0002ejspindex_jsp_161._jspService(_0002findex_0002ejspindex_jsp _161.java:513) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.j ava:184) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:328) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:407) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC hain.java:215) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j ava:251) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.j ava:196) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java: 242) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2041) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:16 1) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:225 ) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.jav a:159) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java :818) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:897 ) at java.lang.Thread.run(Thread.java:484) Root Cause: javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE at org.apache.struts.util.RequestUtils.message(RequestUtils.java:285) at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:239) at _0002findex_0002ejspindex_jsp_161._jspService(_0002findex_0002ejspindex_jsp _161.java:168) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.j ava:184) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:328) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:407) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC hain.java:215) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j ava:251) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.j ava:196) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at
RE: Resources.properties - trick?
I'm not sure how (or why) you should use the Struts implementation without using the Action servlet. However, Sun's i18n tutorial provides guidelines for using ResourceBundles backed up with properties files. http://java.sun.com/docs/books/tutorial/i18n/index.html Mark -Original Message- From: Darryl [mailto:[EMAIL PROTECTED]] Sent: 09 April 2001 13:11 To: [EMAIL PROTECTED] Subject: Re: Resources.properties - trick? Michael, Sorry, it looks like I've responded too quickly to your note. I must have been asleep when I read your note to have missed that you were using init-params. I apologize for the misstep. I think Mark has probably identified your problem correctly. Mark, any idea how to use a MessageResource file WITHOUT having to use ActionServlet. thanks, Darryl "Geddes, Mark (ANTS)" wrote: Is your ResourceBundle called "Resources.properties" or "Resource.properties"? Your mail implies a mis-match. Also, I assume your init-param is for the Struts Action Servlet. Mark -Original Message- From: Michael Schommer [mailto:[EMAIL PROTECTED]] Sent: 09 April 2001 12:57 To: [EMAIL PROTECTED] Subject: Resources.properties - trick? Hi, is there a trick using a "Resource.properties"-file. I'm creating a "Resource.properties"-file in WEB-INF/classes folder of my application. The web.xml looks like: ... init-param param-nameapplication/param-name param-valueResources/param-value /init-param ... In the JSP-file the bean:message-Tag is: bean:message key="index.benutzername"/ By running the application an error displays The Error is: A Servlet Exception Has Occurred Exception Report: javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextIm pl.java:481) at _0002findex_0002ejspindex_jsp_161._jspService(_0002findex_0002ejspindex_jsp _161.java:513) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.j ava:184) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:328) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:407) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC hain.java:215) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j ava:251) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.j ava:196) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java: 242) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2041) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:16 1) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:225 ) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.jav a:159) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java :818) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:897 ) at java.lang.Thread.run(Thread.java:484) Root Cause: javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE at org.apache.struts.util.RequestUtils.message(RequestUtils.java:285) at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:239) at _0002findex_0002ejspindex_jsp_161._jspService(_0002findex_0002ejspindex_jsp _161.java:168) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.j ava:184) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:328) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:407) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC hain.java:215)
Re: Resources.properties - trick?
Sorry, my ResourceBundle is called Resources.properties of course - the error was in the mail. Is there any other idea??? ...what could be wrong? |+--- || Darryl | || [EMAIL PROTECTED]| || o.za| || | || 09.04.01 | || 14:10| || Please | || respond to | || struts-user | || | |+--- ---| | | | To: [EMAIL PROTECTED] | | cc: (bcc: Michael Schommer/PDD/DEV/LU/FERNBACH) | | Subject: Re: Resources.properties - trick? | ---| Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: quoted-printable Michael, Sorry, it looks like I've responded too quickly to your note. I must ha= ve been asleep when I read your note to have missed that you were using init-params. I apologize for the misstep. I think Mark has probably identified your problem correctly. Mark, any = idea how to use a MessageResource file WITHOUT having to use ActionServlet. thanks, Darryl "Geddes, Mark (ANTS)" wrote: Is your ResourceBundle called "Resources.properties" or "Resource.properties"? Your mail implies a mis-match. Also, I assume your init-param is for the Struts Action Servlet. Mark -Original Message- From: Michael Schommer [mailto:[EMAIL PROTECTED]] Sent: 09 April 2001 12:57 To: [EMAIL PROTECTED] Subject: Resources.properties - trick? Hi, is there a trick using a "Resource.properties"-file. I'm creating a "Resource.properties"-file in WEB-INF/classes folder o= f my application. The web.xml looks like: ... init-param param-nameapplication/param-name param-valueResources/param-value /init-param ... In the JSP-file the bean:message-Tag is: bean:message key=3D"index.benutzername"/ By running the application an error displays The Error is: A Servlet Exception Has Occurred Exception Report: javax.servlet.ServletException: Cannot find message resources under k= ey org.apache.struts.action.MESSAGE at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageConte= xtIm pl.java:481) at _0002findex_0002ejspindex_jsp_161._jspService(_0002findex_0002ejspindex= _jsp _161.java:513) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:85= 3) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServl= et.j ava:184) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3= 28) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:407) at javax.servlet.http.HttpServlet.service(HttpServlet.java:85= 3) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil= terC hain.java:215) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal= ve.j ava:251) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977)= at org.apache.catalina.core.StandardContextValve.invoke(StandardContextVal= ve.j ava:196) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.j= ava: 242) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975)= at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:20= 41) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jav= a:16 1) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java= :225 ) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975)= at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve= .jav a:159) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977)= at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.= java :818) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java= :897 ) at java.lang.Thread.run(Thread.java:484) Root Cause: javax.servlet.jsp.JspException: Cannot find message resources under k= ey org.apache.struts.action.MESSAGE at org.apache.struts.util.RequestUtils.message(RequestUtils.java:285) at
RE: Resources.properties - trick?
Is your ActionServlet being loaded on startup? Is your ResourceBundle not in a package? The param-value should be a fully qualified class. Mark -Original Message- From: Michael Schommer [mailto:[EMAIL PROTECTED]] Sent: 09 April 2001 13:33 To: [EMAIL PROTECTED] Subject: Re: Resources.properties - trick? Sorry, my ResourceBundle is called Resources.properties of course - the error was in the mail. Is there any other idea??? ...what could be wrong? |+--- || Darryl | || [EMAIL PROTECTED]| || o.za| || | || 09.04.01 | || 14:10| || Please | || respond to | || struts-user | || | |+--- ---| | | | To: [EMAIL PROTECTED] | | cc: (bcc: Michael Schommer/PDD/DEV/LU/FERNBACH) | | Subject: Re: Resources.properties - trick? | ---| Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: quoted-printable Michael, Sorry, it looks like I've responded too quickly to your note. I must ha= ve been asleep when I read your note to have missed that you were using init-params. I apologize for the misstep. I think Mark has probably identified your problem correctly. Mark, any = idea how to use a MessageResource file WITHOUT having to use ActionServlet. thanks, Darryl "Geddes, Mark (ANTS)" wrote: Is your ResourceBundle called "Resources.properties" or "Resource.properties"? Your mail implies a mis-match. Also, I assume your init-param is for the Struts Action Servlet. Mark -Original Message- From: Michael Schommer [mailto:[EMAIL PROTECTED]] Sent: 09 April 2001 12:57 To: [EMAIL PROTECTED] Subject: Resources.properties - trick? Hi, is there a trick using a "Resource.properties"-file. I'm creating a "Resource.properties"-file in WEB-INF/classes folder o= f my application. The web.xml looks like: ... init-param param-nameapplication/param-name param-valueResources/param-value /init-param ... In the JSP-file the bean:message-Tag is: bean:message key=3D"index.benutzername"/ By running the application an error displays The Error is: A Servlet Exception Has Occurred Exception Report: javax.servlet.ServletException: Cannot find message resources under k= ey org.apache.struts.action.MESSAGE at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageConte= xtIm pl.java:481) at _0002findex_0002ejspindex_jsp_161._jspService(_0002findex_0002ejspindex= _jsp _161.java:513) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:85= 3) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServl= et.j ava:184) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3= 28) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:407) at javax.servlet.http.HttpServlet.service(HttpServlet.java:85= 3) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil= terC hain.java:215) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal= ve.j ava:251) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977)= at org.apache.catalina.core.StandardContextValve.invoke(StandardContextVal= ve.j ava:196) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.j= ava: 242) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975)= at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:20= 41) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jav= a:16 1) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java= :225 ) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975)= at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve= .jav a:159) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977)= at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.= java :818) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java= :897 )
Re: Resources.properties - trick?
Mark, One scenario would be when I'm doing some prototyping and I don't want to necessarily setup an ActionServlet to do some quick form designs etc. I might however, want to quickly play around with the page parameters using a properties file. This is in fact the scenario in which I find myself right now. I'm POC'ing a template-based framework and I wanted to do a few screen prototypes but couldn't get the properties file stuff to work, hence my initial note. I didn't want to implement a separate solution as you suggested I should do before I could determine whether or not something existed within Struts to do the same. Thanks nonetheless for the responses. - Darryl "Geddes, Mark (ANTS)" wrote: I'm not sure how (or why) you should use the Struts implementation without using the Action servlet. However, Sun's i18n tutorial provides guidelines for using ResourceBundles backed up with properties files. http://java.sun.com/docs/books/tutorial/i18n/index.html Mark -Original Message- From: Darryl [mailto:[EMAIL PROTECTED]] Sent: 09 April 2001 13:11 To: [EMAIL PROTECTED] Subject: Re: Resources.properties - trick? Michael, Sorry, it looks like I've responded too quickly to your note. I must have been asleep when I read your note to have missed that you were using init-params. I apologize for the misstep. I think Mark has probably identified your problem correctly. Mark, any idea how to use a MessageResource file WITHOUT having to use ActionServlet. thanks, Darryl "Geddes, Mark (ANTS)" wrote: Is your ResourceBundle called "Resources.properties" or "Resource.properties"? Your mail implies a mis-match. Also, I assume your init-param is for the Struts Action Servlet. Mark -Original Message- From: Michael Schommer [mailto:[EMAIL PROTECTED]] Sent: 09 April 2001 12:57 To: [EMAIL PROTECTED] Subject: Resources.properties - trick? Hi, is there a trick using a "Resource.properties"-file. I'm creating a "Resource.properties"-file in WEB-INF/classes folder of my application. The web.xml looks like: ... init-param param-nameapplication/param-name param-valueResources/param-value /init-param ... In the JSP-file the bean:message-Tag is: bean:message key="index.benutzername"/ By running the application an error displays The Error is: A Servlet Exception Has Occurred Exception Report: javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextIm pl.java:481) at _0002findex_0002ejspindex_jsp_161._jspService(_0002findex_0002ejspindex_jsp _161.java:513) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.j ava:184) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:328) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:407) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC hain.java:215) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j ava:251) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.j ava:196) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java: 242) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2041) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:16 1) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:225 ) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.jav a:159) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java :818) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:897 ) at java.lang.Thread.run(Thread.java:484) Root Cause: javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE at
Re: Resources.properties - trick?
09/04/2001 17:44:58, Darryl [EMAIL PROTECTED] wrote: Mark, One scenario would be when I'm doing some prototyping and I don't want to necessarily setup an ActionServlet to do some quick form designs etc. I might however, want to quickly play around with the page parameters using a properties file. It's actually pretty quick to setup an Action servlet, I just did it for a prototype here, up and running in 2 days. Unfortunately now the use of open source code is a problem for our company, so looks like we'll have to re-invent the wheel :( Cheers, Menno
POSTing arrays in struts
I've read a couple archived notes on this topic and it's not helping me so here goes. I'm trying to post an array of data from my view (JSP) into my bean. I'm having great difficulty. Here is a JSP snipet of what I'm doing: html:form action="/saveEmployees" table tr td align="left" html:text property="data.rows[1].EmployeeName" size="30" maxlength ="30"/ /td /tr td align="right" html:submit bean:message key="button.save"/ /html:submit /td td align="left" html:reset bean:message key="button.reset"/ /html:reset nbsp; html:cancel bean:message key="button.cancel"/ /html:cancel /td /table /html:form My form consists of a getData().getRows().EmployeeName. The Rows is the array. I've added the appropriate getRows(int index) and setRows(int index, ...). Still, it doesn't work. Upon the post I do not see my getters being called and I get no data in my corresponding form. Help???
Is Struts with Websphere that slow ?
Hi all, I did (at last) install a struts application on WebSphere - Advanced 3.5.3 on NTsp6 (with the proposed modification of GetTag.java for "better" support of templates), but it is quite slow. It seems to always reload jsp pages, even afert I put the automatic reloading option in my application advanced tab to "false". I unfortunately develop this application under Resin, and it works really well and really fast ... Is there anybody experiencing such a slow response time ? Is it possibly linked to the use of templates ? Thanks, Bernard.
RE: POSTing arrays in struts
1. use the iterate tag to iterate through the rows property 2. nothing happens on post because you have no input tags -Original Message- From: Will Spies/Towers Perrin [SMTP:[EMAIL PROTECTED]] Sent: 09 April 2001 14:35 To: [EMAIL PROTECTED] Subject: POSTing arrays in struts I've read a couple archived notes on this topic and it's not helping me so here goes. I'm trying to post an array of data from my view (JSP) into my bean. I'm having great difficulty. Here is a JSP snipet of what I'm doing: html:form action="/saveEmployees" table tr td align="left" html:text property="data.rows[1].EmployeeName" size="30" maxlength ="30"/ /td /tr td align="right" html:submit bean:message key="button.save"/ /html:submit /td td align="left" html:reset bean:message key="button.reset"/ /html:reset nbsp; html:cancel bean:message key="button.cancel"/ /html:cancel /td /table /html:form My form consists of a getData().getRows().EmployeeName. The Rows is the array. I've added the appropriate getRows(int index) and setRows(int index, ...). Still, it doesn't work. Upon the post I do not see my getters being called and I get no data in my corresponding form. Help???
RE: Is Struts with Websphere that slow ?
No, the problem is WebSphere. Use Tomcat instead. -Original Message- From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]] Sent: 09 April 2001 14:47 To: [EMAIL PROTECTED] Subject: Is Struts with Websphere that slow ? Hi all, I did (at last) install a struts application on WebSphere - Advanced 3.5.3 on NTsp6 (with the proposed modification of GetTag.java for "better" support of templates), but it is quite slow. It seems to always reload jsp pages, even afert I put the automatic reloading option in my application advanced tab to "false". I unfortunately develop this application under Resin, and it works really well and really fast ... Is there anybody experiencing such a slow response time ? Is it possibly linked to the use of templates ? Thanks, Bernard.
RE: POSTing arrays in struts
1. The iterate tag does not generate index properties for the html_text *input* tag 2. The html:text IS in input tag! To: "'[EMAIL PROTECTED]'" "Taylor, [EMAIL PROTECTED] Jeremy" cc: (bcc: Will Spies/Towers Perrin) jtaylor@lehmSubject: RE: POSTing arrays in struts an.COM 04/09/01 10:08 AM Please respond to struts-user 1. use the iterate tag to iterate through the rows property 2. nothing happens on post because you have no input tags -Original Message- From: Will Spies/Towers Perrin [SMTP:[EMAIL PROTECTED]] Sent: 09 April 2001 14:35 To: [EMAIL PROTECTED] Subject: POSTing arrays in struts I've read a couple archived notes on this topic and it's not helping me so here goes. I'm trying to post an array of data from my view (JSP) into my bean. I'm having great difficulty. Here is a JSP snipet of what I'm doing: html:form action="/saveEmployees" table tr td align="left" html:text property="data.rows[1].EmployeeName" size="30" maxlength ="30"/ /td /tr td align="right" html:submit bean:message key="button.save"/ /html:submit /td td align="left" html:reset bean:message key="button.reset"/ /html:reset nbsp; html:cancel bean:message key="button.cancel"/ /html:cancel /td /table /html:form My form consists of a getData().getRows().EmployeeName. The Rows is the array. I've added the appropriate getRows(int index) and setRows(int index, ...). Still, it doesn't work. Upon the post I do not see my getters being called and I get no data in my corresponding form. Help???
Application intialisation failing
Hi! I have been building an application based on Struts 1.0-b1, but I have a problem. It seems that the message resources that are initialised when the ActionServlet is loading are not stored into the servlet container properly. The MessageResource (ApplicationResources.properties) is loaded and stored in the servlet context, but when they are retrieved later (using RequestUtils.message()) they are no longer in the application scope. This gives me an exception of the style: javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE at org.apache.struts.util.RequestUtils.message(RequestUtils.java:285) at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:239) since the message resources are equall to null. Has anyone encountered anything similar? What am I missing? (I am using Weblogic 5.1 sp8) I am grateful for any help! - Rasmus __ Internet. Artic. http://www.artic.net/
Link Tag Question - how to turn off Jsessionid
Title: Link Tag Question - how to turn off Jsessionid Hi all, I know that in LinkTag has hyperlink method check the Action.TRANSACTION_TOKEN_KEY and append the sessionid for URL rewriting purpose. and i wonder is it configurable so i can turn it on and off and where can i do it. please help! Thanks. See-Yam
RE: POSTing arrays in struts
If all your input fields have the same name then when the form is submitted there will be a in your Action class there will be a method "perform" has takes a parameter HttpServletRequest request, so, rather than doing PropertyUtils.copyProperties(user, form); do something like String[] rows = request.getParameterValues("InputFieldName"); form.setRows(rows); -Original Message- From: Will Spies/Towers Perrin [SMTP:[EMAIL PROTECTED]] Sent: 09 April 2001 15:41 To: [EMAIL PROTECTED] Cc: '[EMAIL PROTECTED]' Subject: RE: POSTing arrays in struts Ok. Now we are talking. Q1: My save action class DOES work like the example. It gets the form and expects the ActionServlet to fill it up. By the time I get the form, the ActionServlet is done with it? How would I change this to work properly or do I need a new version of the util class? Q2: I was under the impression the html:text tags did not work properly inside an iterate tag. To: "'[EMAIL PROTECTED]'" "Taylor, [EMAIL PROTECTED] Jeremy" cc: (bcc: Will Spies/Towers Perrin) jtaylor@lehmSubject: RE: POSTing arrays in struts an.COM 04/09/01 10:32 AM Please respond to struts-user You don't need to generate index properties for the input tags. Also, how does your save action class work? If you based it on the struts examples you'll need to change it because the util class that copies bean properties won't work with the array of values for the rows property. -Original Message- From: Will Spies/Towers Perrin [SMTP:[EMAIL PROTECTED]] Sent: 09 April 2001 15:13 To: [EMAIL PROTECTED] Cc: '[EMAIL PROTECTED]' Subject: RE: POSTing arrays in struts 1. The iterate tag does not generate index properties for the html_text *input* tag 2. The html:text IS in input tag! To: "'[EMAIL PROTECTED]'" "Taylor, [EMAIL PROTECTED] Jeremy" cc: (bcc: Will Spies/Towers Perrin) jtaylor@lehmSubject: RE: POSTing arrays in struts an.COM 04/09/01 10:08 AM Please respond to struts-user 1. use the iterate tag to iterate through the rows property 2. nothing happens on post because you have no input tags -Original Message- From: Will Spies/Towers Perrin [SMTP:[EMAIL PROTECTED]] Sent: 09 April 2001 14:35 To: [EMAIL PROTECTED] Subject: POSTing arrays in struts I've read a couple archived notes on this topic and it's not helping me so here goes. I'm trying to post an array of data from my view (JSP) into my bean. I'm having great difficulty. Here is a JSP snipet of what I'm doing: html:form action="/saveEmployees" table tr td align="left" html:text property="data.rows[1].EmployeeName" size="30" maxlength ="30"/ /td /tr td align="right" html:submit bean:message key="button.save"/ /html:submit /td td align="left" html:reset bean:message key="button.reset"/ /html:reset nbsp; html:cancel bean:message key="button.cancel"/ /html:cancel /td /table /html:form My form consists of a getData().getRows().EmployeeName. The Rows is the array. I've added the appropriate getRows(int index) and setRows(int index, ...). Still, it doesn't work. Upon the post I do not see my getters being called and I get no data in my corresponding form. Help???
Re: Digester parser error
Hi! To bad, Digester seems to be a good idea but this bug is making it impossible for me to use it. All I need is someone to take the final- declaration away, then I could inherit Digester and override the methods I want. Is there any plan on doing that change soon? Erik -Original Message- From: "Deadman, Hal" [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: RE: Digester parser error to another output. I submitted a bug report about this issue on Friday. You can add your comments or vote for it. It's bug #1166. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1166 Hal -Original Message- From: Noel Sebastien [mailto:[EMAIL PROTECTED]] Sent: Monday, April 02, 2001 11:01 AM To: '[EMAIL PROTECTED]' Subject: Digester parser error to another output. Hi, I use Digester, and I would like to send output error elsewhere than to System.out... Second, Digester does not propagate parsing error (in my case, I would like to get an Exception when a String is written as an attribute value where I am waiting a integer). Dealing with the same problems, somebody else wrote the following message. I found it in the Archive of the mailing list, but I can't find any related solutions, whereas it is a common problem. Has anybody got a clue on how to solve these issues? Thank you in advance. SĆ©bastien Archive mail : --- Digester seems to be a pretty nice package for translating XML into java-objects. I have a question about the error handling though. It appears that the Digester doesn't propagate some parsing errors, e.g when a required element is missning. It only logs it to stdout. I haven't found any way to get notification of those errors. I want to make sure that the XML I have parsed, is validate before I use the parsed information. Also, I don't want all the parsing errors to be written to stdout, because I want to take care of the errors and maybe write to other logs (and perhaps in other formats) than to stdout. Since Digester is declared final one cannot subclass it and override the log-methods(or the error-, warning- and fatalError-methods). - Un courrier Ć©lectronique n'engage pas son Ć©metteur. Tout message susceptible de comporter un engagement doit ĆŖtre confirmĆ© par un Ć©crit dĆ»ment signĆ©. An electronic message is not binding on its sender. Any message referring to a binding engagement must be confirmed in writing and duly signed. Ein elektronischer Brief bzw. eine elektronische Nachricht ist fĆ¼r den Absender nicht verbindlich. Jede Nachricht, welche eine Verpflichtung beinhaltet, muĆ schriftlich bestƤtigt und ordnungsgemĆ¤Ć unterzeichnet werden. - __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
RE: How to use multiple datasources ?
Add the attribute 'key=abc' to your data-source configuration. In your action class, use DataSource ds = servlet.findDataSource("abc"); Mark -Original Message- From: Zeltser, Mark [mailto:[EMAIL PROTECTED]] Sent: 09 April 2001 15:52 To: '[EMAIL PROTECTED]' Subject: RE: How to use multiple datasources ? I am interested in this one too... Mark. -Original Message- From: Szlapa, Michael [SMTP:[EMAIL PROTECTED]] Sent: Friday, April 06, 2001 2:05 PM To: '[EMAIL PROTECTED]' Subject: How to use multiple datasources ? Does anyone know how to configure and use multiple datasources ? Thanks in advance Michael -Original Message- From: Szlapa, Michael [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 04, 2001 11:11 AM To: '[EMAIL PROTECTED]' Subject:How to use multiple datasources ? Hi I have problems understanding how I should configure multiple datasources to be used in single application, possibly even in single Action or JSP page. I've read in API description of ActionServlet.dataSources The JDBC data sources that has been configured for this application, if any, keyed by the servlet context attribute under which they are stored. I guess I don't understand what "servlet context attribute" means here, I have only one application with one servlet (ActionServlet), how I should configure name of the context attribute ? I think it would be nice if I could specify datasource name in the struts-config like: data-sources data-source autoCommit="false" name="My name" description="Trial access to database" driverClass="oracle.jdbc.driver.OracleDriver" maxCount="4" minCount="2" password="123" url="jdbc:oracle:thin:@ado:1521:123" user="123" / /data-sources and then do findDataSource("My name"); I have looked also at the Struts guide to find more about data-source section, but it only talks about default connection. TIA Michael -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers Inc. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. *** This email message contains confidential information for the above addressee only. If you are not the intended addressee you must not disclose or use the information in any manner whatsoever. Any opinion or views contained in this email message are those of the sender, do not represent those of the Company in any way and reliance should not be placed upon its contents. Unless otherwise stated this email message is not intended to be contractually binding. Where an Agreement exists between our respective companies and there is conflict between the contents of this email message and the Agreement then the terms of that Agreement shall prevail. Abbey National Treasury Services plc. Registered in England. Registered Office: Abbey House, Baker Street, London NW1 6XL. Company Registration No: 2338548. Regulated by the SFA ***
RE: POSTing arrays in struts
I don't really understand why I have to do this. That's a lot of code to write too. The JSP code that I have below actually works on the read. Struts handles it fine and I see the actual data sitting in the input control when the form comes up in my browser. If struts can do that, I can't see why struts can't go the other way and match it up on a post so my "form' already has the data way before the 'perform' method is called. To: "'[EMAIL PROTECTED]'" "Taylor, [EMAIL PROTECTED] Jeremy" cc: (bcc: Will Spies/Towers Perrin) jtaylor@lehmSubject: RE: POSTing arrays in struts an.COM 04/09/01 11:04 AM Please respond to struts-user If all your input fields have the same name then when the form is submitted there will be a in your Action class there will be a method "perform" has takes a parameter HttpServletRequest request, so, rather than doing PropertyUtils.copyProperties(user, form); do something like String[] rows = request.getParameterValues("InputFieldName"); form.setRows(rows); -Original Message- From: Will Spies/Towers Perrin [SMTP:[EMAIL PROTECTED]] Sent: 09 April 2001 15:41 To: [EMAIL PROTECTED] Cc: '[EMAIL PROTECTED]' Subject: RE: POSTing arrays in struts Ok. Now we are talking. Q1: My save action class DOES work like the example. It gets the form and expects the ActionServlet to fill it up. By the time I get the form, the ActionServlet is done with it? How would I change this to work properly or do I need a new version of the util class? Q2: I was under the impression the html:text tags did not work properly inside an iterate tag. To: "'[EMAIL PROTECTED]'" "Taylor, [EMAIL PROTECTED] Jeremy" cc: (bcc: Will Spies/Towers Perrin) jtaylor@lehmSubject: RE: POSTing arrays in struts an.COM 04/09/01 10:32 AM Please respond to struts-user You don't need to generate index properties for the input tags. Also, how does your save action class work? If you based it on the struts examples you'll need to change it because the util class that copies bean properties won't work with the array of values for the rows property. -Original Message- From: Will Spies/Towers Perrin [SMTP:[EMAIL PROTECTED]] Sent: 09 April 2001 15:13 To: [EMAIL PROTECTED] Cc: '[EMAIL PROTECTED]' Subject: RE: POSTing arrays in struts 1. The iterate tag does not generate index properties for the html_text *input* tag 2. The html:text IS in input tag! To: "'[EMAIL PROTECTED]'" "Taylor, [EMAIL PROTECTED] Jeremy" cc: (bcc: Will Spies/Towers Perrin) jtaylor@lehmSubject: RE: POSTing arrays in struts an.COM 04/09/01 10:08 AM Please respond to struts-user 1. use the iterate tag to iterate through the rows property 2. nothing happens on post because you have no
RE: Is Struts with Websphere that slow ? - any other problems?
3.5.2 is not the right version i believe (maybe it works maybe it doesnt) because websphere only supports jsp1.1/servlet2.2 with 3.5.3 (tag support) johan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, April 09, 2001 4:48 PM To: [EMAIL PROTECTED] Subject: RE: Is Struts with Websphere that slow ? - any other problems? hi, are there any major problems with websphere and struts? I am especially interested in known problems with WAS AE 3.5.2 on Solaris. Thanks, -hendrik
RE: Is Struts with Websphere that slow ? - any other problems?
Hendrik: It's a bear to configure the first time but thereafter its not bad at all. :) Bernard: My app's templates do about 5 includes per page and anything that does that will take a performance hit, however I have not noticed it reload every time, nor have I found the performance hit to be very tangible (at least with just one user). I'm not sure what to tell you. :( -Chris -Original Message- From: Johan Compagner [mailto:[EMAIL PROTECTED]] Sent: Monday, April 09, 2001 11:12 AM To: [EMAIL PROTECTED] Subject: RE: Is Struts with Websphere that slow ? - any other problems? 3.5.2 is not the right version i believe (maybe it works maybe it doesnt) because websphere only supports jsp1.1/servlet2.2 with 3.5.3 (tag support) johan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, April 09, 2001 4:48 PM To: [EMAIL PROTECTED] Subject: RE: Is Struts with Websphere that slow ? - any other problems? hi, are there any major problems with websphere and struts? I am especially interested in known problems with WAS AE 3.5.2 on Solaris. Thanks, -hendrik
RE: [junit] [ANNOUNCE] Cactus 1.0 beta 1
Sweet. :) -Chris - Original Message - From: "Vincent Massol" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 09, 2001 10:35 AM Subject: [junit] [ANNOUNCE] Cactus 1.0 beta 1 I'm proud to announce the immediate availability of the Cactus 1.0 beta 1 framework. It is an extension to JUnit, for testing server side java code (servlets, EJBs, ...). Cactus (formerly known as J2EEUnit) has been donated to the Apache group. Cactus is now living in the Jakarta project and more specifically is a subproject of the Jakarta Commons project. The Jakarta Commons project is a set of frameworks/tools that are useful for all the other Jakarta projects. Cactus is now going to be used for unit testing all other Jakarta projects, beginning with Struts. Cactus announcement on Jakarta : http://jakarta.apache.org/site/news.html Cactus home page : http://jakarta.apache.org/commons/cactus Jakarta-Commons home page : http://jakarta.apache.org/commons Thanks Vincent Massol Yahoo! Groups Sponsor -~-~ Find software faster. Search more than 20,000 software solutions on KnowledgeStorm. Register now and get started. http://us.click.yahoo.com/kVJDAA/zMSCAA/Ig4EAA/N0AVlB/TM -_- To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Re: [junit] [ANNOUNCE] Cactus 1.0 beta 1
- Original Message - From: "Paul Sanford Friedman" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 09, 2001 5:16 PM Subject: Fw: [junit] [ANNOUNCE] Cactus 1.0 beta 1 - Original Message - From: "Vincent Massol" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 09, 2001 10:35 AM Subject: [junit] [ANNOUNCE] Cactus 1.0 beta 1 I'm proud to announce the immediate availability of the Cactus 1.0 beta 1 framework. It is an extension to JUnit, for testing server side java code (servlets, EJBs, ...). Cactus (formerly known as J2EEUnit) has been donated to the Apache group. Cactus is now living in the Jakarta project and more specifically is a subproject of the Jakarta Commons project. The Jakarta Commons project is a set of frameworks/tools that are useful for all the other Jakarta projects. Cactus is now going to be used for unit testing all other Jakarta projects, beginning with Struts. After rereading my announcement, it seems I was a bit too enthousiastic when I wrote the sentence "Cactus is now going to be used for unit testing all other Jakarta projects". Sounds rather pompous ... :( I'd like to remove the sentence altogether. So please ignore it and sorry for that ... Cactus announcement on Jakarta : http://jakarta.apache.org/site/news.html Cactus home page : http://jakarta.apache.org/commons/cactus Jakarta-Commons home page : http://jakarta.apache.org/commons Thanks Vincent Massol Vincent.
File uploading- anyone storing files in Oracle?
I am curious what Struts users are doing with files after using html:file to upload them... Is anyone storing them in an Oracle database (via JDBC)? Not really a Struts specific question, but I would be grateful of any advice or examples. Thanks! Bob
RE: POSTing arrays in struts
It could, but it doesnt. Why not fix the Util class so that it does then submit it back to the commiters? -Original Message- From: Will Spies/Towers Perrin [SMTP:[EMAIL PROTECTED]] Sent: 09 April 2001 16:13 To: [EMAIL PROTECTED] Cc: '[EMAIL PROTECTED]' Subject: RE: POSTing arrays in struts I don't really understand why I have to do this. That's a lot of code to write too. The JSP code that I have below actually works on the read. Struts handles it fine and I see the actual data sitting in the input control when the form comes up in my browser. If struts can do that, I can't see why struts can't go the other way and match it up on a post so my "form' already has the data way before the 'perform' method is called. To: "'[EMAIL PROTECTED]'" "Taylor, [EMAIL PROTECTED] Jeremy" cc: (bcc: Will Spies/Towers Perrin) jtaylor@lehmSubject: RE: POSTing arrays in struts an.COM 04/09/01 11:04 AM Please respond to struts-user If all your input fields have the same name then when the form is submitted there will be a in your Action class there will be a method "perform" has takes a parameter HttpServletRequest request, so, rather than doing PropertyUtils.copyProperties(user, form); do something like String[] rows = request.getParameterValues("InputFieldName"); form.setRows(rows); -Original Message- From: Will Spies/Towers Perrin [SMTP:[EMAIL PROTECTED]] Sent: 09 April 2001 15:41 To: [EMAIL PROTECTED] Cc: '[EMAIL PROTECTED]' Subject: RE: POSTing arrays in struts Ok. Now we are talking. Q1: My save action class DOES work like the example. It gets the form and expects the ActionServlet to fill it up. By the time I get the form, the ActionServlet is done with it? How would I change this to work properly or do I need a new version of the util class? Q2: I was under the impression the html:text tags did not work properly inside an iterate tag. To: "'[EMAIL PROTECTED]'" "Taylor, [EMAIL PROTECTED] Jeremy" cc: (bcc: Will Spies/Towers Perrin) jtaylor@lehmSubject: RE: POSTing arrays in struts an.COM 04/09/01 10:32 AM Please respond to struts-user You don't need to generate index properties for the input tags. Also, how does your save action class work? If you based it on the struts examples you'll need to change it because the util class that copies bean properties won't work with the array of values for the rows property. -Original Message- From: Will Spies/Towers Perrin [SMTP:[EMAIL PROTECTED]] Sent: 09 April 2001 15:13 To: [EMAIL PROTECTED] Cc: '[EMAIL PROTECTED]' Subject: RE: POSTing arrays in struts 1. The iterate tag does not generate index properties for the html_text *input* tag 2. The html:text IS in input tag! To: "'[EMAIL PROTECTED]'" "Taylor, [EMAIL PROTECTED] Jeremy" cc: (bcc: Will Spies/Towers Perrin) jtaylor@lehmSubject: RE: POSTing arrays in struts an.COM 04/09/01 10:08 AM Please respond to struts-user 1. use the iterate tag to iterate through the rows property 2. nothing happens on post because you have no input tags -Original Message- From: Will Spies/Towers Perrin [SMTP:[EMAIL PROTECTED]] Sent: 09 April 2001 14:35 To: [EMAIL PROTECTED] Subject: POSTing arrays in struts I've read a couple archived notes on this topic and it's not helping me so here goes. I'm trying to post an array of data from my view (JSP) into my bean. I'm having great difficulty. Here is a JSP snipet of what I'm doing: html:form action="/saveEmployees" table tr td align="left" html:text property="data.rows[1].EmployeeName"
AW: File uploading- anyone storing files in Oracle?
More Information about storing BLOBS via JDBC: http://developer.java.sun.com/developer/onlineTraining/Database/JDBC20Intro/ JDBC20.html bis denne Olaf Kaus --- Fachhochschule Hannover, Fachbereich Informatik University of Applied Science, Computer Science mailto:[EMAIL PROTECTED] -Ursprngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Gesendet: Montag, 9. April 2001 17:33 An: [EMAIL PROTECTED] Betreff: File uploading- anyone storing files in Oracle? I am curious what Struts users are doing with files after using html:file to upload them... Is anyone storing them in an Oracle database (via JDBC)? Not really a Struts specific question, but I would be grateful of any advice or examples. Thanks! Bob
RE: The Struts Architecture... what is 'business logic'
Hi all. ***This is an architectural question about STRUTS, not a syntactic one*** I'm new to the STRUTS-user group, so apologies if this is a FAQ-type question - would appreciate redirection if it is... I have been reading about the JSP Model 2 architecture - seems great for what we need. But a few of us are having a discussion that I'm hoping you may be able to help with. Here's one proposed J2EE stack for our work -JSP -DHTML using XML/XSLT data islands -using usebean calls to populate the XML -RequestController -creating/referencing a number of request handlers -using a central 'browse session' object for application state -forwarding the user onto the relevant JSP for a particular request -EJB (stateless session) -Data abstraction layer (not entity EJB) -Data sources (format unimportant) I'm going to leave the description there, because I'd like some of the more experienced designers out there to suggest questions about the above stack. If no questions arise, allow me to ask a question of you: === What kind of 'state' do you think could/should be stored in the central 'browse session' object? === Should this be UI-specific information (such as 'this user is currently on page 4 out of 10 of search results') or more generic UI-independent information (such as the 100 search results themselves, which may be displayed 10 at a time, or 100 all at once). In the above stack, the 'browse session' speaks to the stateless session EJB, gets the results, stores all 100 results and then forwards the user to a JSP that either shows 10 results at a time, or all 100 results. It also deals with the pagination between pages when there are 10 results/page. Is this sensible, or is there a point to be made in not bundling it all together? Cheers Dave Small
select tag attribute disable
Hi, I'm using a form using struts and the struts-html tag library and a select tag. When I'm editing an entry in the form I want to disable the select box while still displaying it with what's selected and have it enabled when creating a new entry. I would have thought simply inserting the attribute something like this would work but it doesn't. html:select property="type" DISABLE Any suggestions? Joel Schmidt Software Engineer Apex Learning Phone 425.468.6790 Ext 6790 Email [EMAIL PROTECTED]
RE: select tag attribute disable
Your best bet is to display static text for the existing entries because I doubt HTML supports disabling a select box. You would probably need to use Javascript to prevent someone from changing a select option but that would be annoying. If they can't change something, why put it in a select box? Hal -Original Message- From: Joel Schmidt [mailto:[EMAIL PROTECTED]] Sent: Monday, April 09, 2001 12:55 PM To: [EMAIL PROTECTED] Subject: select tag attribute disable Hi, I'm using a form using struts and the struts-html tag library and a select tag. When I'm editing an entry in the form I want to disable the select box while still displaying it with what's selected and have it enabled when creating a new entry. I would have thought simply inserting the attribute something like this would work but it doesn't. html:select property="type" DISABLE Any suggestions? Joel Schmidt Software Engineer Apex Learning Phone 425.468.6790 Ext 6790 Email [EMAIL PROTECTED]
Re: The Struts Architecture... what is 'business logic'
unsubscribe
RE: Problems in setting up Weblogic5.1 + SP8 + Jakarta-Struts
Hello, In the jakarta website there is information about deploying struts applications on weblogic. Follow the instructions and you will achieve success. I know this from experience :) cheers, Amar.. -Original Message- From: Lu, Wei [mailto:[EMAIL PROTECTED]] Sent: Monday, April 09, 2001 1:08 PM To: '[EMAIL PROTECTED]' Subject: Problems in setting up Weblogic5.1 + SP8 + Jakarta-Struts Hello, I got in trouble in setting up Weblogic5.1 + SP8 + Jakarta-Struts. I followed the instruction in the INSTALL file and tried to deploy struts-example.war. But I failed. Could anybody tell me where I should put that ApplicationResources.properties file? The INSTALL file said it should be at C:\jakart-struts\webapps\WEB-INF\_tem_war, but it seems to be not to work. Thank you. Wei Lu
Re: Is Struts with Websphere that slow ? - any other problems?
"Assenza, Chris" wrote: Hendrik: It's a bear to configure the first time but thereafter its not bad at all. :) Bernard: My app's templates do about 5 includes per page and anything that does that will take a performance hit, however I have not noticed it reload every time, nor have I found the performance hit to be very tangible (at least with just one user). I'm not sure what to tell you. :( I have played around with the admin console and removed completely the logging in OSE. And it worked. Fast as resin. At least. Bernard.
Re: Is Struts with Websphere that slow ? - any other problems?
thanks everyone for your quick feedback! -hendrik
RE: Problems in setting up Weblogic5.1 + SP8 + Jakarta-Struts
This was just an example (specific to where I installed Struts), the path will most likely be different on your machine. You will need to see where WL creates the temp directory for the application and then copy the properties file to this location. The properties file must also be placed in the appropriate directory structure (corresponding to the full package name). -Original Message- From: Lu, Wei [mailto:[EMAIL PROTECTED]] Sent: Monday, April 09, 2001 1:08 PM To: '[EMAIL PROTECTED]' Subject: Problems in setting up Weblogic5.1 + SP8 + Jakarta-Struts Hello, I got in trouble in setting up Weblogic5.1 + SP8 + Jakarta-Struts. I followed the instruction in the INSTALL file and tried to deploy struts-example.war. But I failed. Could anybody tell me where I should put that ApplicationResources.properties file? The INSTALL file said it should be at C:\jakart-struts\webapps\WEB-INF\_tem_war, but it seems to be not to work. Thank you. Wei Lu
set and get the cookies
Hi, How will I set and get the cookies using strut, can you give me some sample. Thanks Sundaram
RE: Problems in setting up Weblogic5.1 + SP8 + Jakarta-Struts
What's the error that you are getting? -Original Message- From: Lu, Wei [mailto:[EMAIL PROTECTED]] Sent: Monday, April 09, 2001 1:08 PM To: '[EMAIL PROTECTED]' Subject: Problems in setting up Weblogic5.1 + SP8 + Jakarta-Struts Hello, I got in trouble in setting up Weblogic5.1 + SP8 + Jakarta-Struts. I followed the instruction in the INSTALL file and tried to deploy struts-example.war. But I failed. Could anybody tell me where I should put that ApplicationResources.properties file? The INSTALL file said it should be at C:\jakart-struts\webapps\WEB-INF\_tem_war, but it seems to be not to work. Thank you. Wei Lu
Default value
Hello friends, I'm trying to give default value to some form elements by assigning this value in 'reset' method of 'ActionForm' child class, but it's not working: text boxes have no text, select elements always show the first item. Any advices will be highly appreciated. Best of luck, Yuriy Zubarev ___ Do You Yahoo!? Get your free @yahoo.ca address at http://mail.yahoo.ca
RE: Problems in setting up Weblogic5.1 + SP8 + Jakarta-Struts
Thank you very much ofr your response. The class package reads org.apache.struts.example. So I opened the struts-example.war file and copied ApplicationResources.properties and appended in the folder "example". However, I still got the enclosed error message. Thank you for help. Wei Lu Mon Apr 09 14:14:31 EDT 2001:I ServletContext-struts-example *.jsp: param wo rkingDir initialized to: C:\jakarta-struts\webapps\_tmp_war Mon Apr 09 14:14:31 EDT 2001:I ServletContext-struts-example *.jsp: param pa geCheckSeconds initialized to: 1 Mon Apr 09 14:14:31 EDT 2001:I ServletContext-struts-example *.jsp: initiali zation complete Mon Apr 09 14:14:31 EDT 2001:I ServletContext-struts-example *.jsp: ## ## pageCheckSeconds over-ruled in JSPServlet to : 1 ## ## Mon Apr 09 14:14:32 EDT 2001:E ServletContext-struts-example Servlet failed with Exception javax.servlet.ServletException: runtime failure in custom tag 'html' at jsp_servlet._index._jspService(_index.java:449) at weblogic.servlet.jsp.JspBase.service(JspBase.java:27) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm pl.java:105) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm pl.java:123) at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon textImpl.java:742) at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon textImpl.java:686) at weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet ContextManager.java:247) at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav a:361) at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120) Mon Apr 09 14:14:32 EDT 2001:E ServletContext-struts-example root cause of S ervletException javax.servlet.ServletException: runtime failure in custom tag 'message' at jsp_servlet._index._jspService(_index.java:105) at weblogic.servlet.jsp.JspBase.service(JspBase.java:27) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm pl.java:105) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm pl.java:123) at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon textImpl.java:742) at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon textImpl.java:686) at weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet ContextManager.java:247) at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav a:361) at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
Please explain these lines to me.
Hi, I amusing the example struts app to modify my present web app. I am using one bean across a number of forms. Each form populates this bean. In my loginaction servlet I create an instance of a bean and place it into the session. I then intend to have that bean used across all forms. In the second page I have the following lines in my Page2action servlet: if(mapping.getAttribute()!=null) { if("request".equals(mapping.getScope())) { request.removeAttribute(mapping.getAttribute()); } else { session.removeAttribute(mapping.getAttribute()); } } return (mapping.findForward("success")); Why are these lines there. I can understand that if the present bean being used is of request scope then take it out but then why are you also taking out a bean that is of session scope? When my app gets to page 3 the info entered on page one is gone. What I think is happening is that page 2 fills the bean, the page 2 action servlet removes the bean from the session. When page 3 gets the bean, it does not exist so it is created but it is empty. Should the remove bean from session lines be removed? Thanks Alex
How to pass messages between pages.
Hi, simple questions. On web page 1 the user enters something. The page 1 action servlet hits the database and creates a record. Lets say the servlet gets a record number back. On page 2 you want to notify the user of the record number. How can you pass the number created by the 1 action servlet to the second page. Do I have to create a message bean or something to pass a string between pages? Thanks for any help. Alex
RE: Problems in setting up Weblogic5.1 + SP8 + Jakarta-Struts
This is the error you will see when WL can't find the properties file. You are positive that the properties file is in the proper directory? Also you must restart WL after you copy the file. If this still doesn't work then I am sorry I don't have any other suggestions for deploying in the WAR :( However, another option is to expand the WAR file and set the WL classpath- see the instructions. -Bob -Original Message- From: Lu, Wei [mailto:[EMAIL PROTECTED]] Sent: Monday, April 09, 2001 2:19 PM To: '[EMAIL PROTECTED]' Subject: RE: Problems in setting up Weblogic5.1 + SP8 + Jakarta-Struts Thank you very much ofr your response. The class package reads org.apache.struts.example. So I opened the struts-example.war file and copied ApplicationResources.properties and appended in the folder "example". However, I still got the enclosed error message. Thank you for help. Wei Lu Mon Apr 09 14:14:31 EDT 2001:I ServletContext-struts-example *.jsp: param wo rkingDir initialized to: C:\jakarta-struts\webapps\_tmp_war Mon Apr 09 14:14:31 EDT 2001:I ServletContext-struts-example *.jsp: param pa geCheckSeconds initialized to: 1 Mon Apr 09 14:14:31 EDT 2001:I ServletContext-struts-example *.jsp: initiali zation complete Mon Apr 09 14:14:31 EDT 2001:I ServletContext-struts-example *.jsp: ## ## pageCheckSeconds over-ruled in JSPServlet to : 1 ## ## Mon Apr 09 14:14:32 EDT 2001:E ServletContext-struts-example Servlet failed with Exception javax.servlet.ServletException: runtime failure in custom tag 'html' at jsp_servlet._index._jspService(_index.java:449) at weblogic.servlet.jsp.JspBase.service(JspBase.java:27) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm pl.java:105) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm pl.java:123) at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon textImpl.java:742) at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon textImpl.java:686) at weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet ContextManager.java:247) at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav a:361) at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120) Mon Apr 09 14:14:32 EDT 2001:E ServletContext-struts-example root cause of S ervletException javax.servlet.ServletException: runtime failure in custom tag 'message' at jsp_servlet._index._jspService(_index.java:105) at weblogic.servlet.jsp.JspBase.service(JspBase.java:27) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm pl.java:105) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm pl.java:123) at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon textImpl.java:742) at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon textImpl.java:686) at weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet ContextManager.java:247) at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav a:361) at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
RE: POSTing arrays in struts
This issue has come up quite regularly in the list. I got round this by taking my own copies of struts tags and modifying them so that they check if they are contained in an "IterateTag". If they are then I generate the name appropriately using the property from the IterateTag, the current index value and the property from the actual tag. Struts then automatically populates the data back appropriately. You have to do something a bit more complex if your using request rather than session scope to generate a bean collection but thats the only issue. For Example: logic:iterate id="list" name="formExample" property="beanArray" trtdhtml:text name="list" property="desc"//td /logic:iterate generates: input type="text" name="beanArray[0].desc" value=".."/ input type="text" name="beanArray[1].desc" value=".."/ input type="text" name="beanArray[2].desc" value=".."/ etc. etc. With my modified iterate and text ( BaseFieldTag) tags. This then causes Struts to generate appropriate method calls to populate the values back to the form [e.g. formExample.getBeanArray(0).setCode(..) etc.] I detailed this a couple of times as a request but unfortunately so far no one has given any feedback. Even if this proposal is no accepted then putting the logic to generate the "name" attribute in separate methods which could be overriden rather than copying the tag and having to change the doStartTag() method would be really useful. Previous messages: http://www.mail-archive.com/struts-user@jakarta.apache.org/msg05231.html http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg00975.html Niall P.S I also have a similar issue where I want to overide the default behaviour for setting the "value" attribute for another issue. -Original Message- From: Will Spies/Towers Perrin [mailto:[EMAIL PROTECTED]] Sent: 09 April 2001 16:13 To: [EMAIL PROTECTED] Cc: '[EMAIL PROTECTED]' Subject: RE: POSTing arrays in struts I don't really understand why I have to do this. That's a lot of code to write too. The JSP code that I have below actually works on the read. Struts handles it fine and I see the actual data sitting in the input control when the form comes up in my browser. If struts can do that, I can't see why struts can't go the other way and match it up on a post so my "form' already has the data way before the 'perform' method is called. To: "'[EMAIL PROTECTED]'" "Taylor, [EMAIL PROTECTED] Jeremy" cc: (bcc: Will Spies/Towers Perrin) jtaylor@lehmSubject: RE: POSTing arrays in struts an.COM 04/09/01 11:04 AM Please respond to struts-user If all your input fields have the same name then when the form is submitted there will be a in your Action class there will be a method "perform" has takes a parameter HttpServletRequest request, so, rather than doing PropertyUtils.copyProperties(user, form); do something like String[] rows = request.getParameterValues("InputFieldName"); form.setRows(rows); -Original Message- From: Will Spies/Towers Perrin [SMTP:[EMAIL PROTECTED]] Sent: 09 April 2001 15:41 To: [EMAIL PROTECTED] Cc: '[EMAIL PROTECTED]' Subject: RE: POSTing arrays in struts Ok. Now we are talking. Q1: My save action class DOES work like the example. It gets the form and expects the ActionServlet to fill it up. By the time I get the form, the ActionServlet is done with it? How would I change this to work properly or do I need a new version of the util class? Q2: I was under the impression the html:text tags did not work properly inside an iterate tag. To: "'[EMAIL PROTECTED]'" "Taylor, [EMAIL PROTECTED] Jeremy" cc: (bcc: Will Spies/Towers Perrin) jtaylor@lehmSubject: RE: POSTing arrays in struts an.COM 04/09/01 10:32 AM Please respond to struts-user You don't need to generate index properties for the input tags. Also, how does your save action class work? If you based it on the struts examples you'll need to change it because the util class that copies bean properties won't work with the array of values for the rows property. -Original Message- From: Will Spies/Towers Perrin [SMTP:[EMAIL PROTECTED]] Sent: 09 April 2001 15:13 To: [EMAIL PROTECTED] Cc: '[EMAIL PROTECTED]' Subject: RE: POSTing arrays in
logic:iterate questions
Two questions, please. 1) Why do I have to include the 'name' attribute of logic:iterate when inside an html:form element? It seems gross to have the same string in both the JSP page and the form-bean element in struts-config.xml. 2) I have a bean that has a collection of Phone objects, accessible via its getPhones() method. Shouldn't I be able to return EITHER a Phone[] or a java.util.Collection? The following element works fine when a Collection is returned, but I get an error ("No getter method for property phones of bean myForm") when a Phone[] is returned. logic:iterate id="phone" name="myForm" property="phones" tr td bean:write name="phone" property="type" / /td td html:text name="phone" property="number" / /td /tr /logic:iterate Thanks in advance.
RE: POSTing arrays in struts
Thanks for your reply. I did see these messages and I'm ok with fixing the iterate tag issue. I have a bigger (related) problem. My problem is when I get a POST struts does not fill in my ActionForm correctly. For example, in your example my LoginForm would not contain a beanArray with 3 elements. It would contain 0. Struts is failing to generate the proper getter calls as far as I can tell. To: [EMAIL PROTECTED] "Niall Pemberton" cc: (bcc: Will Spies/Towers Perrin) niall.pemberton@btIntSubject: RE: POSTing arrays in struts ernet.com 04/09/01 03:05 PM Please respond to struts-user This issue has come up quite regularly in the list. I got round this by taking my own copies of struts tags and modifying them so that they check if they are contained in an "IterateTag". If they are then I generate the name appropriately using the property from the IterateTag, the current index value and the property from the actual tag. Struts then automatically populates the data back appropriately. You have to do something a bit more complex if your using request rather than session scope to generate a bean collection but thats the only issue. For Example: logic:iterate id="list" name="formExample" property="beanArray" trtdhtml:text name="list" property="desc"//td /logic:iterate generates: input type="text" name="beanArray[0].desc" value=".."/ input type="text" name="beanArray[1].desc" value=".."/ input type="text" name="beanArray[2].desc" value=".."/ etc. etc. With my modified iterate and text ( BaseFieldTag) tags. This then causes Struts to generate appropriate method calls to populate the values back to the form [e.g. formExample.getBeanArray(0).setCode(..) etc.] I detailed this a couple of times as a request but unfortunately so far no one has given any feedback. Even if this proposal is no accepted then putting the logic to generate the "name" attribute in separate methods which could be overriden rather than copying the tag and having to change the doStartTag() method would be really useful. Previous messages: http://www.mail-archive.com/struts-user@jakarta.apache.org/msg05231.html http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg00975.html Niall P.S I also have a similar issue where I want to overide the default behaviour for setting the "value" attribute for another issue. -Original Message- From: Will Spies/Towers Perrin [mailto:[EMAIL PROTECTED]] Sent: 09 April 2001 16:13 To: [EMAIL PROTECTED] Cc: '[EMAIL PROTECTED]' Subject: RE: POSTing arrays in struts I don't really understand why I have to do this. That's a lot of code to write too. The JSP code that I have below actually works on the read. Struts handles it fine and I see the actual data sitting in the input control when the form comes up in my browser. If struts can do that, I can't see why struts can't go the other way and match it up on a post so my "form' already has the data way before the 'perform' method is called. To: "'[EMAIL PROTECTED]'" "Taylor, [EMAIL PROTECTED] Jeremy" cc: (bcc: Will Spies/Towers Perrin) jtaylor@lehmSubject: RE: POSTing arrays in struts an.COM 04/09/01 11:04 AM Please respond to struts-user If all your input fields have the same name then when the form is submitted there will be a in your Action class there will be a method "perform" has takes a parameter HttpServletRequest request, so,
Timeout for DataSource
What is the easiest way to set a timeout for a query in the struts connection pool? I'm using Oracle 8 with the native driver. David __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
RE: POSTing arrays in struts
I don't know if I understand your situation but is this a scope issue? Either you use session scope and set up your beanArray before showing the form, then when a POST is done Struts will call the appropriate setters on the beans in the array. Or you use request scope which is a bit more tricky because the bean array is empty so Struts can't call the setters. In this case I got round this by generating beans as the setters were being called: In my ActionForm class: private Vector beanVector; public MyBean getBeanVector(int index) { if (beanVector == null) beanVector = new Vector(15, 5); if (index+1 beanVector.size()) { for (int i = beanVector.size(); i index+1; i++) { beanVector.add(new MyBean()); } } return (MyBean)beanVector.get(index); } Thus Struts tags: logic:iterate id="list" name="myForm" property="beanVector" trtdhtml:text name="list" property="desc"//td /logic:iterate generates: input type="text" name="beanVector[0].desc" value="abc"/ input type="text" name="beanVector[1].desc" value="def"/ input type="text" name="beanVector[2].desc" value="ghi"/ Causing Struts to generate the following method call to populate your bean array in your ActionForm: getBeanVector(0).setDesc("abc"); getBeanVector(1).setDesc("def"); getBeanVector(2).setDesc("ghi"); -Original Message- From: Will Spies/Towers Perrin [mailto:[EMAIL PROTECTED]] Sent: 09 April 2001 20:37 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: POSTing arrays in struts Thanks for your reply. I did see these messages and I'm ok with fixing the iterate tag issue. I have a bigger (related) problem. My problem is when I get a POST struts does not fill in my ActionForm correctly. For example, in your example my LoginForm would not contain a beanArray with 3 elements. It would contain 0. Struts is failing to generate the proper getter calls as far as I can tell. To: [EMAIL PROTECTED] "Niall Pemberton" cc: (bcc: Will Spies/Towers Perrin) niall.pemberton@btIntSubject: RE: POSTing arrays in struts ernet.com This issue has come up quite regularly in the list. I got round this by taking my own copies of struts tags and modifying them so that they check if they are contained in an "IterateTag". If they are then I generate the name appropriately using the property from the IterateTag, the current index value and the property from the actual tag. Struts then automatically populates the data back appropriately. You have to do something a bit more complex if your using request rather than session scope to generate a bean collection but thats the only issue. For Example: logic:iterate id="list" name="formExample" property="beanArray" trtdhtml:text name="list" property="desc"//td /logic:iterate generates: input type="text" name="beanArray[0].desc" value=".."/ input type="text" name="beanArray[1].desc" value=".."/ input type="text" name="beanArray[2].desc" value=".."/ etc. etc. With my modified iterate and text ( BaseFieldTag) tags. This then causes Struts to generate appropriate method calls to populate the values back to the form [e.g. formExample.getBeanArray(0).setCode(..) etc.] I detailed this a couple of times as a request but unfortunately so far no one has given any feedback. Even if this proposal is no accepted then putting the logic to generate the "name" attribute in separate methods which could be overriden rather than copying the tag and having to change the doStartTag() method would be really useful. Previous messages: http://www.mail-archive.com/struts-user@jakarta.apache.org/msg05231.html http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg00975.html Niall P.S I also have a similar issue where I want to overide the default behaviour for setting the "value" attribute for another issue. -Original Message- From: Will Spies/Towers Perrin [mailto:[EMAIL PROTECTED]] Sent: 09 April 2001 16:13 To: [EMAIL PROTECTED] Cc: '[EMAIL PROTECTED]' Subject: RE: POSTing arrays in struts I don't really understand why I have to do this. That's a lot of code to write too. The JSP code that I have below actually works on the read. Struts handles it fine and I see the actual data sitting in the input control when the form comes up in my browser. If struts can do that, I can't see why struts can't go the other way and match it up on a post so my "form' already has the data way before the 'perform' method is called. To: "'[EMAIL PROTECTED]'" "Taylor, [EMAIL PROTECTED] Jeremy" cc: (bcc: Will Spies/Towers Perrin) jtaylor@lehmSubject:
help with JavaScript and text box.
Hi, I have a text box mapped to a bean via: html:text property="requisitionLines.requiredOnDate" size="10" / My form is called requisition. If I try to set the value of the text box via JavaScript I have to access the box via form.object or requisition.requsitionLine.requiredOnDate. JavaScript can't find the box due to the numerous '.'. Is there a way around this to access the box. Any help is appreciated. Regards Alex
RE: POSTing arrays in struts
That is my situation exactly. I've tried session scope and request scope. For request, I did the same exact trick you have here. Both cases it's not working for me. My ActionForm is not getting populated at all. I am one level of indirection lower than what you have here but same concept. If you have this working though the problem could just be that I'm messing up somewhere and one of my properties is coming back null. I didn't think so though. What build are you using? To: [EMAIL PROTECTED] "Niall Pemberton" cc: (bcc: Will Spies/Towers Perrin) niall.pemberton@btIntSubject: RE: POSTing arrays in struts ernet.com 04/09/01 03:58 PM Please respond to struts-user I don't know if I understand your situation but is this a scope issue? Either you use session scope and set up your beanArray before showing the form, then when a POST is done Struts will call the appropriate setters on the beans in the array. Or you use request scope which is a bit more tricky because the bean array is empty so Struts can't call the setters. In this case I got round this by generating beans as the setters were being called: In my ActionForm class: private Vector beanVector; public MyBean getBeanVector(int index) { if (beanVector == null) beanVector = new Vector(15, 5); if (index+1 beanVector.size()) { for (int i = beanVector.size(); i index+1; i++) { beanVector.add(new MyBean()); } } return (MyBean)beanVector.get(index); } Thus Struts tags: logic:iterate id="list" name="myForm" property="beanVector" trtdhtml:text name="list" property="desc"//td /logic:iterate generates: input type="text" name="beanVector[0].desc" value="abc"/ input type="text" name="beanVector[1].desc" value="def"/ input type="text" name="beanVector[2].desc" value="ghi"/ Causing Struts to generate the following method call to populate your bean array in your ActionForm: getBeanVector(0).setDesc("abc"); getBeanVector(1).setDesc("def"); getBeanVector(2).setDesc("ghi"); -Original Message- From: Will Spies/Towers Perrin [mailto:[EMAIL PROTECTED]] Sent: 09 April 2001 20:37 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: POSTing arrays in struts Thanks for your reply. I did see these messages and I'm ok with fixing the iterate tag issue. I have a bigger (related) problem. My problem is when I get a POST struts does not fill in my ActionForm correctly. For example, in your example my LoginForm would not contain a beanArray with 3 elements. It would contain 0. Struts is failing to generate the proper getter calls as far as I can tell. To: [EMAIL PROTECTED] "Niall Pemberton" cc: (bcc: Will Spies/Towers Perrin) niall.pemberton@btIntSubject: RE: POSTing arrays in struts ernet.com This issue has come up quite regularly in the list. I got round this by taking my own copies of struts tags and modifying them so that they check if they are contained in an "IterateTag". If they are then I generate the name appropriately using the property from the IterateTag, the current index value and the property from the actual tag. Struts then automatically populates the data back appropriately. You have to do something a bit more complex if your using request rather than session scope to generate a bean collection but thats the only issue. For Example: logic:iterate id="list" name="formExample" property="beanArray" trtdhtml:text name="list" property="desc"//td /logic:iterate
RE: Struts samples on iPlanet 6.0 sp2 - newbie quesion
The GX error is due to the fact that iPlanet could not see your servlet. GX2GX means it could not find the servlet in the iPlanet LDAP or registry. Doing a servlet registration is non-trival with iPlanet. You need to use the iPlanet deployment tool. good luck, malcolm -Original Message- From: Vijaya Narasimha [mailto:[EMAIL PROTECTED]] Sent: Monday, April 09, 2001 8:44 AM To: '[EMAIL PROTECTED]' Subject: Struts samples on iPlanet 6.0 sp2 - newbie quesion Has anyone deployed the Struts samples on iPlanet 6.0 sp2 successfully? I keep getting a GX Error (GX2GX) socket result code missing!!! whenever I try to run any struts application. However I tried deploying the HelloWorld example of iPlanet and it works just fine. Thanks for the help.
Re: How to pass messages between pages.
Not sure I understand - isn't already in your form bean that you share between pages? You could always add it as a request variable. Dave "Alex Colic" [EMAIL PROTECTED] on 04/09/2001 02:54:01 PM Please respond to [EMAIL PROTECTED] To: "Struts" [EMAIL PROTECTED] cc:(bcc: David Hay/Lex/Lexmark) Subject: How to pass messages between pages. Hi, simple questions. On web page 1 the user enters something. The page 1 action servlet hits the database and creates a record. Lets say the servlet gets a record number back. On page 2 you want to notify the user of the record number. How can you pass the number created by the 1 action servlet to the second page. Do I have to create a message bean or something to pass a string between pages? Thanks for any help. Alex
Re: How to pass messages between pages.
You can always place a Collection or String[] into request scope and use the iterate tag to loop through them for display. I made a message tag that is similar to the errors tag, but for general messages (such as 'User X successfully deleted'). If you want to look at what I did it is posted at http://home.earthlink.net/~dwinterfeldt. David --- [EMAIL PROTECTED] wrote: Not sure I understand - isn't already in your form bean that you share between pages? You could always add it as a request variable. Dave "Alex Colic" [EMAIL PROTECTED] on 04/09/2001 02:54:01 PM Please respond to [EMAIL PROTECTED] To: "Struts" [EMAIL PROTECTED] cc:(bcc: David Hay/Lex/Lexmark) Subject: How to pass messages between pages. Hi, simple questions. On web page 1 the user enters something. The page 1 action servlet hits the database and creates a record. Lets say the servlet gets a record number back. On page 2 you want to notify the user of the record number. How can you pass the number created by the 1 action servlet to the second page. Do I have to create a message bean or something to pass a string between pages? Thanks for any help. Alex __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
iterating text boxes and radio buttons within iterate tags
Hi all: I am iterating the text boxes and radio button. The names are coming from the database. The HTML should like this. I have my strut snippnet at the end. Perhaps some one has tun into this type of situation. tr tdinput type="radio" name="book1" value="hcover"/td tdinput type="radio" name="book1" value="pback"/td tdinput type="text" name="qty1"/td /tr tr tdinput type="radio" name="book2" value="hcover"/td tdinput type="radio" name="book2" value="pback"/td tdinput type="text" name="qty2"/td /tr tr tdinput type="radio" name="book3" value="hcover"/td tdinput type="radio" name="book3" value="pback"/td tdinput type="text" name="qty3"/td /tr book1, book2, book3 and qty1, qty2, qty3 are coming from the database. Using strut docs, I am doing the following, but am getting name="bookNumber" or name="qty": logic:iterate name="formbeanClass" property="arrayObjects" tr tdhtml:radio property="bookNumber" value="hcover"//td tdhtml:radio property="bookNumber" value="pback"//td tdhtml:text property="qty" value="" size="5"//td /tr /logic:iterate where bookNumber and qty are String arrays set in a form beam set. __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
Problem with bean:struts tag
Hi, I am trying to use the bean:struts and bean:write tags to expose(copy) an action form bean and print a property. However when I use the bean:write tag it tells me that there is no getter method for the specified property(helloMessage). As can be seen in the code below, directly before the bean tags I have successfully used the form bean inside the form tags and it prints the specified property with no problems. That is: There is a gettter method for this particular form bean property, and it works). I have assumed that I need to first expose(copy) the form bean with bean:struts and then write the property with bean:write. Is this incorrect? What am I doing wrong? Here is the jsp fragment in question: html:form action="/helloworld" html:text property="helloMessage" size="50"/ /html:form br br bean:struts id="helloBean" formBean="helloworldForm"/ bean:write name="helloBean" property="helloMessage"/ The form bean xml mapping is: form-bean name="helloworldForm" type ="/HelloworldForm"/ Thanks Trev...
RE: Problem with bean:struts tag
I think bean:struts is used to access configuration information from struts-config.xml. Are you trying to use it to access the properties of a particular form instance? You can do that with bean:write directly if the form is already in some scope. Hal -Original Message- From: Trevor Griffiths [mailto:[EMAIL PROTECTED]] Sent: Monday, April 09, 2001 7:12 PM To: [EMAIL PROTECTED] Subject: Problem with bean:struts tag Hi, I am trying to use the bean:struts and bean:write tags to expose(copy) an action form bean and print a property. However when I use the bean:write tag it tells me that there is no getter method for the specified property(helloMessage). As can be seen in the code below, directly before the bean tags I have successfully used the form bean inside the form tags and it prints the specified property with no problems. That is: There is a gettter method for this particular form bean property, and it works). I have assumed that I need to first expose(copy) the form bean with bean:struts and then write the property with bean:write. Is this incorrect? What am I doing wrong? Here is the jsp fragment in question: html:form action="/helloworld" html:text property="helloMessage" size="50"/ /html:form br br bean:struts id="helloBean" formBean="helloworldForm"/ bean:write name="helloBean" property="helloMessage"/ The form bean xml mapping is: form-bean name="helloworldForm" type ="/HelloworldForm"/ Thanks Trev...
RE: Problems in setting up Weblogic5.1 + SP8 + Jakarta-Struts
My experience with WLS 5.1 sp8 has been very tiresome... many days of trial and error getting it to work with struts (and yes I followed the directions on the struts page for wls sp8 -- maybe this works on Windows but definitely not on unix)... Anyway -- the only way to get around the issue you are encountering is to take out the following line in your web.xml: load-on-startup1/load-on-startup Now as a consequence of doing this you will need to follow these two steps every time you restart your weblogic instance: 1. Load a jsp page through your browser before doing anything else (especially a post). This fixes the classloader problem with weblogic 5.1. 2. Next, load the ActionServlet by posting to an action class. This will also load your application.properties. Also I found with this fix you don't have to set the WL classpath as it is stated in the instructions. Hope this helps... --Brian -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, April 09, 2001 1:58 PM To: [EMAIL PROTECTED] Subject: RE: Problems in setting up Weblogic5.1 + SP8 + Jakarta-Struts This is the error you will see when WL can't find the properties file. You are positive that the properties file is in the proper directory? Also you must restart WL after you copy the file. If this still doesn't work then I am sorry I don't have any other suggestions for deploying in the WAR :( However, another option is to expand the WAR file and set the WL classpath- see the instructions. -Bob -Original Message- From: Lu, Wei [mailto:[EMAIL PROTECTED]] Sent: Monday, April 09, 2001 2:19 PM To: '[EMAIL PROTECTED]' Subject: RE: Problems in setting up Weblogic5.1 + SP8 + Jakarta-Struts Thank you very much ofr your response. The class package reads org.apache.struts.example. So I opened the struts-example.war file and copied ApplicationResources.properties and appended in the folder "example". However, I still got the enclosed error message. Thank you for help. Wei Lu Mon Apr 09 14:14:31 EDT 2001:I ServletContext-struts-example *.jsp: param wo rkingDir initialized to: C:\jakarta-struts\webapps\_tmp_war Mon Apr 09 14:14:31 EDT 2001:I ServletContext-struts-example *.jsp: param pa geCheckSeconds initialized to: 1 Mon Apr 09 14:14:31 EDT 2001:I ServletContext-struts-example *.jsp: initiali zation complete Mon Apr 09 14:14:31 EDT 2001:I ServletContext-struts-example *.jsp: ## ## pageCheckSeconds over-ruled in JSPServlet to : 1 ## ## Mon Apr 09 14:14:32 EDT 2001:E ServletContext-struts-example Servlet failed with Exception javax.servlet.ServletException: runtime failure in custom tag 'html' at jsp_servlet._index._jspService(_index.java:449) at weblogic.servlet.jsp.JspBase.service(JspBase.java:27) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm pl.java:105) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm pl.java:123) at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon textImpl.java:742) at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon textImpl.java:686) at weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet ContextManager.java:247) at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav a:361) at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120) Mon Apr 09 14:14:32 EDT 2001:E ServletContext-struts-example root cause of S ervletException javax.servlet.ServletException: runtime failure in custom tag 'message' at jsp_servlet._index._jspService(_index.java:105) at weblogic.servlet.jsp.JspBase.service(JspBase.java:27) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm pl.java:105) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm pl.java:123) at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon textImpl.java:742) at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon textImpl.java:686) at weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet ContextManager.java:247) at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav a:361) at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
RE: POSTing arrays in struts
Yes I have it working and I'm using the beta (i.e. version 1.0-b1). Not quite sure what you mean by "one level of indirection lower" but my suggestion is to set the debug level in BeanUtils - which is what ActionServlet uses to populate the bean - it should give you a whole load of output telling you what its trying to do - unfortunately its using System.out.println so it'll come out to the tomcat console. BeanUtils.setDebug(1); // its a static method Otherwise you could try posting your code here and perhaps someone will be able to spot whats going wrong. Niall -Original Message- From: Will Spies/Towers Perrin [mailto:[EMAIL PROTECTED]] Sent: 09 April 2001 21:30 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: POSTing arrays in struts That is my situation exactly. I've tried session scope and request scope. For request, I did the same exact trick you have here. Both cases it's not working for me. My ActionForm is not getting populated at all. I am one level of indirection lower than what you have here but same concept. If you have this working though the problem could just be that I'm messing up somewhere and one of my properties is coming back null. I didn't think so though. What build are you using? To: [EMAIL PROTECTED] "Niall Pemberton" cc: (bcc: Will Spies/Towers Perrin) niall.pemberton@btIntSubject: RE: POSTing arrays in struts ernet.com I don't know if I understand your situation but is this a scope issue? Either you use session scope and set up your beanArray before showing the form, then when a POST is done Struts will call the appropriate setters on the beans in the array. Or you use request scope which is a bit more tricky because the bean array is empty so Struts can't call the setters. In this case I got round this by generating beans as the setters were being called: In my ActionForm class: private Vector beanVector; public MyBean getBeanVector(int index) { if (beanVector == null) beanVector = new Vector(15, 5); if (index+1 beanVector.size()) { for (int i = beanVector.size(); i index+1; i++) { beanVector.add(new MyBean()); } } return (MyBean)beanVector.get(index); } Thus Struts tags: logic:iterate id="list" name="myForm" property="beanVector" trtdhtml:text name="list" property="desc"//td /logic:iterate generates: input type="text" name="beanVector[0].desc" value="abc"/ input type="text" name="beanVector[1].desc" value="def"/ input type="text" name="beanVector[2].desc" value="ghi"/ Causing Struts to generate the following method call to populate your bean array in your ActionForm: getBeanVector(0).setDesc("abc"); getBeanVector(1).setDesc("def"); getBeanVector(2).setDesc("ghi"); -Original Message- From: Will Spies/Towers Perrin [mailto:[EMAIL PROTECTED]] Sent: 09 April 2001 20:37 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: POSTing arrays in struts Thanks for your reply. I did see these messages and I'm ok with fixing the iterate tag issue. I have a bigger (related) problem. My problem is when I get a POST struts does not fill in my ActionForm correctly. For example, in your example my LoginForm would not contain a beanArray with 3 elements. It would contain 0. Struts is failing to generate the proper getter calls as far as I can tell. To: [EMAIL PROTECTED] "Niall Pemberton" cc: (bcc: Will Spies/Towers Perrin) niall.pemberton@btIntSubject: RE: POSTing arrays in struts ernet.com This issue has come up quite regularly in the list. I got round this by taking my own copies of struts tags and modifying them so that they check if they are contained in an "IterateTag". If they are then I generate the name appropriately using the property from the IterateTag, the current index value and the property from the actual tag. Struts then automatically populates the data back appropriately. You have to do something a bit more complex if your using request rather than session scope to generate a bean collection but thats the only issue. For Example: logic:iterate id="list" name="formExample" property="beanArray" trtdhtml:text name="list" property="desc"//td /logic:iterate generates: input type="text" name="beanArray[0].desc" value=".."/ input type="text" name="beanArray[1].desc" value=".."/ input type="text" name="beanArray[2].desc" value=".."/ etc. etc. With my modified iterate and text ( BaseFieldTag) tags. This then causes Struts to generate appropriate method calls to populate
(Clarification) RE: Problems in setting up Weblogic5.1 + SP8 + Jakarta-Struts
Just wanted to clarify a couple of things... You must remove the load-on-startup tag from under the "Action Servlet Configuration" section of your web.xml. Also... the struts-example will still not work as I described below, because every jsp page in this example requires the application.properties to be loaded already by the action servlet. But you can't load the action servlet first, you must hit a jsp. I wouldn't worry about getting the example to work, just forge ahead... but if you really truely desire to get the example working, just unwar the stuts-example (don't forget to update your weblogic.properties -- it's not a .war anymore) and add your own test.jsp page (doesn't even need any content) under the strut-example directory. Load test.jsp in your browser, then load the action servlet by submiting to the action path "logoff.do". Example: "http://[SERVER_NAME]:PORT/struts-example/test.jsp "http://[SERVER_NAME]:PORT/struts-example/logoff.do Thanks, Brian -Original Message- From: Brian Knorr Sent: Monday, April 09, 2001 7:08 PM To: [EMAIL PROTECTED] Subject: RE: Problems in setting up Weblogic5.1 + SP8 + Jakarta-Struts My experience with WLS 5.1 sp8 has been very tiresome... many days of trial and error getting it to work with struts (and yes I followed the directions on the struts page for wls sp8 -- maybe this works on Windows but definitely not on unix)... Anyway -- the only way to get around the issue you are encountering is to take out the following line in your web.xml: load-on-startup1/load-on-startup Now as a consequence of doing this you will need to follow these two steps every time you restart your weblogic instance: 1. Load a jsp page through your browser before doing anything else (especially a post). This fixes the classloader problem with weblogic 5.1. 2. Next, load the ActionServlet by posting to an action class. This will also load your application.properties. Also I found with this fix you don't have to set the WL classpath as it is stated in the instructions. Hope this helps... --Brian -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, April 09, 2001 1:58 PM To: [EMAIL PROTECTED] Subject: RE: Problems in setting up Weblogic5.1 + SP8 + Jakarta-Struts This is the error you will see when WL can't find the properties file. You are positive that the properties file is in the proper directory? Also you must restart WL after you copy the file. If this still doesn't work then I am sorry I don't have any other suggestions for deploying in the WAR :( However, another option is to expand the WAR file and set the WL classpath- see the instructions. -Bob -Original Message- From: Lu, Wei [mailto:[EMAIL PROTECTED]] Sent: Monday, April 09, 2001 2:19 PM To: '[EMAIL PROTECTED]' Subject: RE: Problems in setting up Weblogic5.1 + SP8 + Jakarta-Struts Thank you very much ofr your response. The class package reads org.apache.struts.example. So I opened the struts-example.war file and copied ApplicationResources.properties and appended in the folder "example". However, I still got the enclosed error message. Thank you for help. Wei Lu Mon Apr 09 14:14:31 EDT 2001:I ServletContext-struts-example *.jsp: param wo rkingDir initialized to: C:\jakarta-struts\webapps\_tmp_war Mon Apr 09 14:14:31 EDT 2001:I ServletContext-struts-example *.jsp: param pa geCheckSeconds initialized to: 1 Mon Apr 09 14:14:31 EDT 2001:I ServletContext-struts-example *.jsp: initiali zation complete Mon Apr 09 14:14:31 EDT 2001:I ServletContext-struts-example *.jsp: ## ## pageCheckSeconds over-ruled in JSPServlet to : 1 ## ## Mon Apr 09 14:14:32 EDT 2001:E ServletContext-struts-example Servlet failed with Exception javax.servlet.ServletException: runtime failure in custom tag 'html' at jsp_servlet._index._jspService(_index.java:449) at weblogic.servlet.jsp.JspBase.service(JspBase.java:27) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm pl.java:105) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm pl.java:123) at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon textImpl.java:742) at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon textImpl.java:686) at weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet ContextManager.java:247) at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav a:361) at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120) Mon Apr 09 14:14:32 EDT 2001:E ServletContext-struts-example root cause of S ervletException javax.servlet.ServletException: runtime failure in custom tag 'message' at
RE: POSTing arrays in struts
I looked at your first message and saw the code snippet you put there. I tried out using your jsp code and put together a couple of classes got it working no problem: html:text property="data.rows[1].employeeName" size="30" maxlength="30"/ One problem I did have was I had to change the above from "EmployeeName" to "employeeName" to get it working. I also used the following classes: In the Action Form: private TestBean data = new TestBean(); public TestBean getData() { return data; } I created a TestBean as follows: public class TestBean { private EmplBean[] rows = new EmplBean[] {new EmplBean("Fred"), new EmplBean("John")}; public EmplBean getRows(int index) { return rows[index]; } } I created an EmplBean as follows: public class EmplBean { public String EmployeeName; public EmplBean(String name) { EmployeeName = name; } public String getEmployeeName() { return EmployeeName; } public void setEmployeeName(String name) { EmployeeName = name; } } -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED]] Sent: 10 April 2001 01:03 To: [EMAIL PROTECTED] Subject: RE: POSTing arrays in struts Yes I have it working and I'm using the beta (i.e. version 1.0-b1). Not quite sure what you mean by "one level of indirection lower" but my suggestion is to set the debug level in BeanUtils - which is what ActionServlet uses to populate the bean - it should give you a whole load of output telling you what its trying to do - unfortunately its using System.out.println so it'll come out to the tomcat console. BeanUtils.setDebug(1); // its a static method Otherwise you could try posting your code here and perhaps someone will be able to spot whats going wrong. Niall -Original Message- From: Will Spies/Towers Perrin [mailto:[EMAIL PROTECTED]] Sent: 09 April 2001 21:30 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: POSTing arrays in struts That is my situation exactly. I've tried session scope and request scope. For request, I did the same exact trick you have here. Both cases it's not working for me. My ActionForm is not getting populated at all. I am one level of indirection lower than what you have here but same concept. If you have this working though the problem could just be that I'm messing up somewhere and one of my properties is coming back null. I didn't think so though. What build are you using? To: [EMAIL PROTECTED] "Niall Pemberton" cc: (bcc: Will Spies/Towers Perrin) niall.pemberton@btIntSubject: RE: POSTing arrays in struts ernet.com I don't know if I understand your situation but is this a scope issue? Either you use session scope and set up your beanArray before showing the form, then when a POST is done Struts will call the appropriate setters on the beans in the array. Or you use request scope which is a bit more tricky because the bean array is empty so Struts can't call the setters. In this case I got round this by generating beans as the setters were being called: In my ActionForm class: private Vector beanVector; public MyBean getBeanVector(int index) { if (beanVector == null) beanVector = new Vector(15, 5); if (index+1 beanVector.size()) { for (int i = beanVector.size(); i index+1; i++) { beanVector.add(new MyBean()); } } return (MyBean)beanVector.get(index); } Thus Struts tags: logic:iterate id="list" name="myForm" property="beanVector" trtdhtml:text name="list" property="desc"//td /logic:iterate generates: input type="text" name="beanVector[0].desc" value="abc"/ input type="text" name="beanVector[1].desc" value="def"/ input type="text" name="beanVector[2].desc" value="ghi"/ Causing Struts to generate the following method call to populate your bean array in your ActionForm: getBeanVector(0).setDesc("abc"); getBeanVector(1).setDesc("def"); getBeanVector(2).setDesc("ghi"); -Original Message- From: Will Spies/Towers Perrin [mailto:[EMAIL PROTECTED]] Sent: 09 April 2001 20:37 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: POSTing arrays in struts Thanks for your reply. I did see these messages and I'm ok with fixing the iterate tag issue. I have a bigger (related) problem. My problem is when I get a POST struts does not fill in my ActionForm correctly. For example, in your example my LoginForm would not contain a beanArray with 3 elements. It would contain 0. Struts is failing to generate the proper getter calls as far as I can tell.
Re: help with JavaScript and text box.
Try document.requisition['requisitionLines.requiredOnDate'].value = "the new value"; Alex Colic wrote: Hi, I have a text box mapped to a bean via: html:text property="requisitionLines.requiredOnDate" size="10" / My form is called requisition. If I try to set the value of the text box via JavaScript I have to access the box via form.object or requisition.requsitionLine.requiredOnDate. JavaScript can't find the box due to the numerous '.'. Is there a way around this to access the box. Any help is appreciated. Regards Alex
RE: POSTing arrays in struts
One problem I did have was I had to change the above from "EmployeeName" to "employeeName" to get it working. Good Java style normally reserves Capitalized identifiers for class declarations. Struts reflection expects you to be following bean naming conventions and styles. I created an EmplBean as follows: With public get/set your bean memeber variable should be private or at least protected. Also, a little white-space never killed anyone. public class EmplBean { private String employeeName; public EmplBean(String employeeName) { this.mployeeName = employeeName; } public String getEmployeeName() { return employeeName; } public void setEmployeeName(String employeeName) { this.employeeName = employeeName; } }
RE: POSTing arrays in struts
Brilliant :-) It was the substance I was concentrating on. -Original Message- From: Matthew O'Haire [mailto:[EMAIL PROTECTED]] Sent: 10 April 2001 02:17 To: '[EMAIL PROTECTED]' Subject: RE: POSTing arrays in struts One problem I did have was I had to change the above from "EmployeeName" to "employeeName" to get it working. Good Java style normally reserves Capitalized identifiers for class declarations. Struts reflection expects you to be following bean naming conventions and styles. I created an EmplBean as follows: With public get/set your bean memeber variable should be private or at least protected. Also, a little white-space never killed anyone. public class EmplBean { private String employeeName; public EmplBean(String employeeName) { this.mployeeName = employeeName; } public String getEmployeeName() { return employeeName; } public void setEmployeeName(String employeeName) { this.employeeName = employeeName; } }
Re: Debugging struts exceptions
On Wed, 4 Apr 2001, Will Spies/Towers Perrin wrote: I didn't get any response so I'm going to try again. Here is another exception: Wed Apr 04 10:53:26 EDT 2001:E WebAppServletContext-tpsampleapp Root cause of ServletException javax.servlet.ServletException: runtime failure in custom tag 'form' at jsp_servlet._employee._jspService(_employee.java, Compiled Code) at weblogic.servlet.jsp.JspBase.service(JspBase.java:27) You might want to complain to WebLogic about this. The actual exception that is thrown *does* contain a more useful error message -- it's just that WebLogic is not telling you about it. Alternatively, you can declare an error page to handle runtime errors. The Struts tags that throw exceptions store a copy of the underlying exception as a request attribute under key "org.apache.struts.action.EXCEPTION", so you can display it yourself. Craig McClanahan
Re: Is Struts with Websphere that slow ? - any other problems?
How does one acquire WAS 3.5.3. Is it in a patch? Thanks, Tom Johan Compagner wrote: 3.5.2 is not the right version i believe (maybe it works maybe it doesnt) because websphere only supports jsp1.1/servlet2.2 with 3.5.3 (tag support) johan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, April 09, 2001 4:48 PM To: [EMAIL PROTECTED] Subject: RE: Is Struts with Websphere that slow ? - any other problems? hi, are there any major problems with websphere and struts? I am especially interested in known problems with WAS AE 3.5.2 on Solaris. Thanks, -hendrik -- Tom Miller Miller Associates, Inc. [EMAIL PROTECTED] 641.469.3535 Phone 413.581.6326 FAX
Re: Bean-applet support?
On Wed, 4 Apr 2001, Menno M Jansz wrote: Is there any support in Struts for bean-applets? We are looking to use Struts but need extensive use of bean-applets in our jsp to provide a rich UI, passing the bean-applets serialised objects via the web tier. Regards, Menno There's no current support for something like this, but it would be interesting to consider. Are you thinking that there would be an applet for each field, or one for the entire form? Craig
Re: 1.0b1 or nightly build?
On Wed, 4 Apr 2001, Wayland Chan wrote: Seeing as 1.0b1 has been available for several weeks now. I was wondering if it would be advisable to use a nightly build instead of the released b1. I noticed the website has the release notes for 1.0b2 up already but I don't see a b2 release available for download anywhere. How close are we to seeing b2 become available? Now that I'm back from two weeks of speaking at conferences, I'm going to focus on cleaning up the remaining bugs reported in Bugzilla http://nagoya.apache.org/bugzilla/ so that we can proceed to a beta 2. In the mean time, I would definitely recommend using the latest nightly builds. Thanks Craig
RE: Confusion with form beans
On Wed, 4 Apr 2001 [EMAIL PROTECTED] wrote: Nigel, Hi. Just to confirm...I would really like to have access to the first form in the action that creates the second form. Can I do that, or do I have to pass the info in as parameters? ie will the first bean PERSIST in the session so I can access it in the following action? It seems that the persisting way is much cleaner. Please let me know if that doesn't make sense!! Dave I *think* the following approach is what you are asking for: * Two forms, "form1.jsp" and "form2.jsp". * Each form has an associated bean ("form1Bean" and "form2Bean"). * Have the "form1.jsp" page submit to an action "/saveForm1". * The corresponding Action for "/saveForm1" can then: - Receive the form1Bean bean that contains the form1.jsp fields - Create a new form2Bean instance, and store it in request scope - Forward to "form2.jsp" * Now, the bean for "form2.jsp" will be pre-initialized, based on whatever processing was done by the Action. This can, of course, including things like copying values from the form1Bean instance. Craig McClanahan
Re: how to initialize image tag
On Wed, 4 Apr 2001, Puneet Vardhan wrote: Hi, Is there a way to initialize image tag . In my jsp form I have multiple image button and I use html:image tag. If I hide first image button conditionally it gives a null pointer exception as it could not initialize image tag object for the other image buttons. Thanks Puneet The only way to debug something like this is if you could include a snippet of your page containing the offending tags, and then report what exception message you are actually receiving. Craig
Re: More about that edit form example...
On Wed, 4 Apr 2001, Bryan Field-Elliot wrote: Question about the following code in EditRegistrationAction: // Populate the user registration form if (form == null) { if (servlet.getDebug() = 1) servlet.log(" Creating new RegistrationForm bean under key " + mapping.getAttribute()); form = new RegistrationForm(); if ("request".equals(mapping.getScope())) request.setAttribute(mapping.getAttribute(), form); else session.setAttribute(mapping.getAttribute(), form); } Is this code ever really executed? My testing from my own app indicates that, even with the ActionMapping's "validate=false", and even with a link directly to the action without any form submission, STILL, there is a construction of an empty ActionForm, and it is passed to the process()'s "form" parameter. So the above code doesn't look like it ever executes. Am I off base here? If the struts-config.xml entry for this action is ever changed so that it doesn't refer to a form bean, the "form" parameter will definitely be null. Even though that's not supposed to happen, I like to code defensively rather than have the potential to throw a NullPointerException. Thanks, Bryan Craig
Re: Connection Pooling, GenericDataSource, JNDI, CachedRowSet
On Thu, 5 Apr 2001, Christophe ThiƩbaud wrote: Hi my problem is : how to make GenericDataSource visible to JNDI ? You have to rely on container-specific configuration to make this happen. For example, in Tomcat 4.0 you can configure an appropriate resource in the conf/server.xml file. If you do this, you would rely on the container to configure the details of the data source, rather than doing it in struts-config.xml. I need to interface a CachedRowSet object - BTW, is there anybody out here using Sun's CachedRowSet ? - with struts's GenericDataSource in a struts-based application. CachedRowsSet can connect to a DataSource object using JNDI., but .. how to make GenericDataSource visible to JNDI ? (Furthermore, If several person share the same need, it might be a good idea to include JNDI directly within GenericDataSource object.) Or, is there a better alternative to GenericDataSource to integrate connection pooling in a struts based application ? Christophe Craig
Re: MOVEING CURSOR INTO THE ERROR FIELD.
On Thu, 5 Apr 2001 [EMAIL PROTECTED] wrote: Hi, I 'am using staruts for a small pilot project. On the form bean when validate method collect errors and shows in JSP, I want at the same time my cursor should move to the first error field. how I can acheive this.. does anybody knows about this... One approach to consider is to remember that the "focus" attribute of the form can take a runtime expression, instead of a String constant, to specify the name of the field to send the cursor to. If you had some mechanism to define a bean (with a string value) named "errorField" then you could say: jsp:useBean id="errorField" class="java.lang.String"/ form action="/xxx" focus="%= errorField %" ... /form Thanks N Regards TAHIR IQBAL Information Services Division (ISD) Loblaw Companies Limited 6 Monogram Place Weston, ON - M9R 4CR * 416-246-7831 Email[EMAIL PROTECTED] "Stay Cool And U'll Rule" Craig
RE: Problem finding classes after forward (resend)
On Thu, 5 Apr 2001, Scott Cressler wrote: Ummm, I'm not using WebLogic ;-) I've figured out some of the problem. I can't do a jsp:useBean of my formBean because (in ActionServlet.processActionForm() ) the bean is put into the request as an ActionForm, not as my class. So I can cast it to ActionForm, but not to my class (com.propel.webapp.actions.AddressForm). I can probably figure out a way around that (maybe by using the bean tags?), but the other problem I'm having is still confusing me What version of Struts are you using? The html:form bean accepts a "type" attribute that you can use to set the fully qualified Java classname of the actual bean. If you don't specify it, the corresponding bean type is looked up based on the corresponding action mapping -- at least with recent nightly versions. Keep on digging, Scott Craig
Re: Is Struts with Websphere that slow ? - any other problems?
It's a fixpack from IBM http://www-4.ibm.com/software/webservers/appserv/efix.html Wayland Chan --- Tom Miller [EMAIL PROTECTED] wrote: How does one acquire WAS 3.5.3. Is it in a patch? Thanks, Tom __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/