[OT] Poolman problem
it seems like there's a bunch of people in here using poolman therefore this mail I oaccasionally get this exception when running my system: NullPointerException at java.util.Hashtable.containsKey(Hashtable.java:299) at com.codestudio.util.JDBCPool.returnPooledStatement(Unknown Source) at com.codestudio.sql.PoolManPreparedStatement.close(Unknown Source) at com.codestudio.util.JDBCPool.closeStatement(Unknown Source) at com.codestudio.sql.PoolManConnection.clean(Unknown Source) at com.codestudio.util.JDBCPool.returnConnection(Unknown Source) at com.codestudio.util.JDBCPool.connectionClosed(Unknown Source) at com.codestudio.sql.PoolManConnection.sendCloseEvent(Unknown Source) at com.codestudio.sql.PoolManConnectionHandle.close(Unknown Source) at com.jbpb.blue.web.ValtechAction.closeConnection(ValtechAction.java:41 Its not fatal (the system continues running) but very unsettling... any suggestions?? thanks in advance mikkel -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: How do I leverage the struts approach within an EJB environment?
You action classes perform function should do a jndi lookup of a session bean (stateless or not, I prefer stateless), passing a value object holding the relevant data. Do not be tempted to use the form bean, create a value object with no struts stuff in.The session bean should then do any data lookups via entity bean business fnuctions or whatever. Again, any data returned should be within value objects which are then used to populate the form. Why do all this? Basically you are using an industry standard RPC mechanism to a middle tier (ie the EJB remote stuff with JNDI lookup). You are decoupling the GUI from the data manipulation which theoretically gives you OO code reuse (like hell, but someone believes this stuff). You do gain scalability advantages (kind of, but lets not think too hard about that eh). Jonathan Message History From: Paul Idusogie [EMAIL PROTECTED] on 13/02/2002 09:41 CST Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc: Subject: How do I leverage the struts approach within an EJB environment? Could someone kindly provide an explanation on how to leverage the struts approach within an EJB environment? we have the component diagram showing the main struts components relative to the MVC pattern. Where do EJBs fit in? ActionServlet -instantiate--ActionForm | | |send |call | |-Action V | | Jsp |use | | |-ActionMapping-- |use | V TagLib Thanks, Paul Idusogie Technical Architect Consulting Services Stellent Inc. Golden Triangle Drive Eden Prairie, MN 55104 Desk: 952.656.2755 Fax: 952.903.2115 Email: [EMAIL PROTECTED] website: http://www.stellent.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Extra Path Info Problem!!! HELP!!!
Not supported, though I wish it were :o( http://www.mail-archive.com/struts-user@jakarta.apache.org/msg11714.html http://www.mail-archive.com/struts-user@jakarta.apache.org/msg11709.html Problem is, an Action URI is not a path, but a string identifier that is make to look like a path. So, someone has to write the code to simulate a path. Another problem is that the Action form tag assumes that all action URIs either don't have extensions or are using extension mapping. So, if you are using something like this: /do/MailMerge.txt This doesn't work as an ActionMapping, but does work as a ActionForward. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Java Web Development with Struts. -- Tel +1 585 737-3463. -- Web http://www.husted.com/struts/ cool dude wrote: Hi Guyz, I'm having a really strange problem wiht struts ... I looked around in the mailing list found a lot of people had similar problems .. but I couldn't find any solution for it. The problem relates to use of extra path info. I have a URL which looks something like this http://myserver.com/servletname/extrapathinfo/actionname I've defined the url mapping in the web.xml as /servletname/*. I was hoping that struts will try pick up only the last component of the URL as the action name I would be able to use the extra path info in my servlet. But it doesn't work that way, instead struts tries to look for an action with the name /extrapathinfo/actionname ... I would really appreciate any idea/leads in solving this problem ... been stuck-up with this for sometime now .. :-( Thanx in advance, VD. __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Ted Husted, Husted dot Com, Fairport NY USA. -- Java Web Development with Struts. -- Tel +1 585 737-3463. -- Web http://www.husted.com/struts/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [OT] Poolman problem
You probably should bring this up to the Poolman team. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Java Web Development with Struts. -- Tel +1 585 737-3463. -- Web http://www.husted.com/struts/ Mikkel Bruun wrote: it seems like there's a bunch of people in here using poolman therefore this mail I oaccasionally get this exception when running my system: NullPointerException at java.util.Hashtable.containsKey(Hashtable.java:299) at com.codestudio.util.JDBCPool.returnPooledStatement(Unknown Source) at com.codestudio.sql.PoolManPreparedStatement.close(Unknown Source) at com.codestudio.util.JDBCPool.closeStatement(Unknown Source) at com.codestudio.sql.PoolManConnection.clean(Unknown Source) at com.codestudio.util.JDBCPool.returnConnection(Unknown Source) at com.codestudio.util.JDBCPool.connectionClosed(Unknown Source) at com.codestudio.sql.PoolManConnection.sendCloseEvent(Unknown Source) at com.codestudio.sql.PoolManConnectionHandle.close(Unknown Source) at com.jbpb.blue.web.ValtechAction.closeConnection(ValtechAction.java:41 Its not fatal (the system continues running) but very unsettling... any suggestions?? thanks in advance mikkel -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Multiple struts-config.xml files?
I asked a similar question re potential problems with multiple action servlet instances(no reply). I think the issues may have something to do with the actionservlet resources but I'm not sure and would be **very** interested in finding out as I'm using this approach using struts 1.0. Jin - Original Message - From: Struts Newsgroup @[EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 8:55 AM Subject: Re: Multiple struts-config.xml files? Subject: Re: Multiple struts-config.xml files? From: Jens Mander [EMAIL PROTECTED] === Which are the alterations required to allow struts 1.0 to permit multiple Action Servlets? Doesn't a container (e.g. Tomcat) generate separate instances for each action servlet which reads its own struts-config file and if so what kind of threading problems could occur? In my case I've been using an approach similar to what Michael describes without the RoleDispatcherServlet and I am worried about these threading problems you mention. Thanks, Ronaldo Ted Husted [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED]... Struts 1.0 isn't designed to permit multiple ActionServlets. Unless you've made some alterations, there may be threading problems. --cut -- Ted Husted, Husted dot Com, Fairport NY USA. -- Java Web Development with Struts. -- Tel +1 585 737-3463. -- Web http://www.husted.com/struts/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Why no indexed attribute defined in struts-html.tld?
I'm having the same problem ... No one to help ??? On Wed, 13 Feb 2002 16:13:31 -0800 Liu, Xin [EMAIL PROTECTED] wrote: Hi, I downloaded Struts 1.01 binary file last month. From Struts on-line doc, I saw the new attribute indexed is added to some html tags. So I tried to use it with the following code: logic:iterate id=oneObejct name=myBean type=com.xy.ObjectA html:text name=oneObject property=phone indexed=yes/ /logic:iterate But the JSP engine told me attribute indexed is invalid. After checking in struts-html.tld, I could not find this attribute: indexed in any element of struts-html.tld. I checked binary download of Struts v 1.02, I still could not find it. Where am I wrong? Or the binary download file is wrong? Thanks! Tony -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Get your firstname@lastname email at http://Nameplanet.com/?su -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Confused over check boxes
Try thinking of it this way. For every JSP page 2 actions take place. The first action is used to populate the form bean and then control is passed to the JSP page. During this phase you can ignore reset and set your properties as you need them. The 2nd action is used to process the user's responses. This is where the reset() method is important to you. Per the HTML spec., unchecked boxes are not placed in the parameter list. Therefore, if the reset method did not uncheck your checkbox for you, then you would not have any way of determining if a user had uncheck any boxes. Hope this helps. - Original Message - From: Ian Beaumont [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, February 13, 2002 10:41 AM Subject: Confused over check boxes I've got a checkbox on a page. It's initial state needs to be checked. In my form I have a boolean value for the check box. It fails to detect correctly if the check box is set. In my reset method I set the check box to true (as this is the initial state), but the help says WARNING: In order to correctly recognize unchecked checkboxes, the ActionForm bean associated with this form must include a statement setting the corresponding boolean property to false in the reset() method. How am I supposed to deal with this situation? Thanks Ian Beaumont -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: URGENT: Null Strings in Websphere
how are you storing your data? is it stored in a database using jdbc? and if so, are you constructing your insert statements as strings and directly appending the values onto the string rather than using bind values? i've seen this problem come up before, and it's always been the case that people aren't using jdbc the way it's meant to be used. their inserts were always done like this: String insert = insert into customer + (customer_id, name, address) + values (customer_seq.nextval, + myCustomer.getName() + , + myCustomer.getAddress() + ); PreparedStatement insertStmt = connection.prepareStatement(insert); insertStmt.executeUpdate(); instead of the correct way, which would be like this: String insert = insert into customer + (customer_id, name, address) + values (customer_seq.nextval, ?, ?); PreparedStatement insertStmt = connection.prepareStatement(insert); insertStmt.setString( 1, myCustomer.getName() ); insertStmt.setString( 2, myCustomer.getAddress() ); insertStmt.executeUpdate(); if you think this is the source of your problem, please read the java tutorial chapter on JDBC asap. ab -Original Message- From: Phillips, George H. [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 12, 2002 3:20 PM To: 'Struts Users Mailing List' Subject: RE: URGENT: Null Strings in Websphere We had a similar problem. Although we were actually getting spaces back from our DB, we were seeing null displayed on our jsp's. We fixed it by explicitly initializing our String fields in our result beans to rather than letting them default to null. I don't know *why* this worked, since you'd think the original null values would be overlaid when a field's setter was called, but for whatever reason, it solved the problem... George Phillips University of Miami [EMAIL PROTECTED] -Original Message- From: Dave J Dandeneau [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 12, 2002 10:39 AM To: Struts Users Mailing List Subject: URGENT: Null Strings in Websphere Whenever we have a String value in our forms, and the value is not set (), it is getting sent back to the jsp as null. By null I mean the actual string, and not an empty object. This is making validation of these fields fail. Has anyone seen this and found a work around. Thanks, Dave Dandeneau -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Using Struts with a Database hangs?
Hi, I am using Struts 1.0 with Pointbase Database in Tomcat4.0.2. When I comment out the datasource in my struts-config.xml, I am able to start TomCat. When I add the following lines back in my struts-config.xml, Tomcat hangs during initialization (i.e. I can never see the line Starting service Tomcat-apache\nApache Tomcat/4.0.2, the last line I can see is Pop org.apache.struts.action.ActionMapping) data-sources data-source autoCommit=true description=Oracle datasource driverClass=com.pointbase.jdbc.jdbcUniversalDriver maxCount=4 minCount=2 password=PUBLIC url=jdbc:pointbase://localhost/sonic user=PUBLIC / /data-sources I have tried the above parameters with the Pointbase client, it can connect to the Pointbase database server. I am sure Tomcat can find my JDBC driver class. Otherwise, I would get a ClassNotFound Exception in my TomCat window. And when I kill the TomCat console (the DOS window), I see the following exception in my Pointbase server window. So I think Tomcat able to make the connection with Pointbase server, but it gets hangs. java.net.SocketException: Connection reset by peer: JVM_recv in socket input str eam read at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:116) at java.io.BufferedInputStream.fill(BufferedInputStream.java:183) at java.io.BufferedInputStream.read(BufferedInputStream.java:201) at java.io.FilterInputStream.read(FilterInputStream.java:66) at com.pointbase.net.netAuditInputStream.read(Unknown Source) at com.pointbase.crypto.cryptoEncryptedInputStream.read(Unknown Source) at com.pointbase.crypto.cryptoEncryptedInputStream.init(Unknown Source) at com.pointbase.crypto.cryptoEncryptedInputStream.read(Unknown Source) at java.io.DataInputStream.readInt(DataInputStream.java:392) at com.pointbase.net.netConnectionHandler.run(Unknown Source) at java.lang.Thread.run(Thread.java:536) Thanks for your help. Sam __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Mapping in Struts-config.xml for a servlet
To be able to call a com.somecompany.servlet.MySimpleServlet through the name SimpleServlet add the following to your web.xml servlet servlet-nameSimpleServlet/servlet-name servlet-classcom.somecompany.servlet.MySimpleServlet/servlet-class /servlet On Thu, 14 Feb 2002 08:54:38 +0530 [EMAIL PROTECTED] wrote: Hello, I want to call a simple servlet from an action class. What is the mapping I have to do in struts-config.xml file. Please look into this Regards Arun -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Get your firstname@lastname email at http://Nameplanet.com/?su -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
SV: Using Struts with a Database hangs?
could be a bug in your jdbc driver??? try using another connection pool...poolman www.codestudio.com is easy to set up and use...see if you get the same errors using that... Mikkel -Oprindelig meddelelse- Fra: Sam Cheung [mailto:[EMAIL PROTECTED]] Sendt: 14. februar 2002 05:19 Til: [EMAIL PROTECTED] Emne: Using Struts with a Database hangs? Hi, I am using Struts 1.0 with Pointbase Database in Tomcat4.0.2. When I comment out the datasource in my struts-config.xml, I am able to start TomCat. When I add the following lines back in my struts-config.xml, Tomcat hangs during initialization (i.e. I can never see the line Starting service Tomcat-apache\nApache Tomcat/4.0.2, the last line I can see is Pop org.apache.struts.action.ActionMapping) data-sources data-source autoCommit=true description=Oracle datasource driverClass=com.pointbase.jdbc.jdbcUniversalDriver maxCount=4 minCount=2 password=PUBLIC url=jdbc:pointbase://localhost/sonic user=PUBLIC / /data-sources I have tried the above parameters with the Pointbase client, it can connect to the Pointbase database server. I am sure Tomcat can find my JDBC driver class. Otherwise, I would get a ClassNotFound Exception in my TomCat window. And when I kill the TomCat console (the DOS window), I see the following exception in my Pointbase server window. So I think Tomcat able to make the connection with Pointbase server, but it gets hangs. java.net.SocketException: Connection reset by peer: JVM_recv in socket input str eam read at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:116) at java.io.BufferedInputStream.fill(BufferedInputStream.java:183) at java.io.BufferedInputStream.read(BufferedInputStream.java:201) at java.io.FilterInputStream.read(FilterInputStream.java:66) at com.pointbase.net.netAuditInputStream.read(Unknown Source) at com.pointbase.crypto.cryptoEncryptedInputStream.read(Unknown Source) at com.pointbase.crypto.cryptoEncryptedInputStream.init(Unknown Source) at com.pointbase.crypto.cryptoEncryptedInputStream.read(Unknown Source) at java.io.DataInputStream.readInt(DataInputStream.java:392) at com.pointbase.net.netConnectionHandler.run(Unknown Source) at java.lang.Thread.run(Thread.java:536) Thanks for your help. Sam __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Using Struts with a Database hangs?
Can you try it with another database system, like Hypersonic or MySQL, just to help identify the exact problem. I'm guessing PointBase can't find something it needs, perhaps related to the crypto* packages. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Java Web Development with Struts. -- Tel +1 585 737-3463. -- Web http://www.husted.com/struts/ Sam Cheung wrote: Hi, I am using Struts 1.0 with Pointbase Database in Tomcat4.0.2. When I comment out the datasource in my struts-config.xml, I am able to start TomCat. When I add the following lines back in my struts-config.xml, Tomcat hangs during initialization (i.e. I can never see the line Starting service Tomcat-apache\nApache Tomcat/4.0.2, the last line I can see is Pop org.apache.struts.action.ActionMapping) data-sources data-source autoCommit=true description=Oracle datasource driverClass=com.pointbase.jdbc.jdbcUniversalDriver maxCount=4 minCount=2 password=PUBLIC url=jdbc:pointbase://localhost/sonic user=PUBLIC / /data-sources I have tried the above parameters with the Pointbase client, it can connect to the Pointbase database server. I am sure Tomcat can find my JDBC driver class. Otherwise, I would get a ClassNotFound Exception in my TomCat window. And when I kill the TomCat console (the DOS window), I see the following exception in my Pointbase server window. So I think Tomcat able to make the connection with Pointbase server, but it gets hangs. java.net.SocketException: Connection reset by peer: JVM_recv in socket input str eam read at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:116) at java.io.BufferedInputStream.fill(BufferedInputStream.java:183) at java.io.BufferedInputStream.read(BufferedInputStream.java:201) at java.io.FilterInputStream.read(FilterInputStream.java:66) at com.pointbase.net.netAuditInputStream.read(Unknown Source) at com.pointbase.crypto.cryptoEncryptedInputStream.read(Unknown Source) at com.pointbase.crypto.cryptoEncryptedInputStream.init(Unknown Source) at com.pointbase.crypto.cryptoEncryptedInputStream.read(Unknown Source) at java.io.DataInputStream.readInt(DataInputStream.java:392) at com.pointbase.net.netConnectionHandler.run(Unknown Source) at java.lang.Thread.run(Thread.java:536) Thanks for your help. Sam __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
SV: [OT] Poolman problem
i know... i send them a mail yesterday...no response yet... just wanted to check as it seems there's alot of guys using poolman on the list... Mikkel -Oprindelig meddelelse- Fra: Ted Husted [mailto:[EMAIL PROTECTED]] Sendt: 14. februar 2002 10:13 Til: Struts Users Mailing List Emne: Re: [OT] Poolman problem You probably should bring this up to the Poolman team. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Java Web Development with Struts. -- Tel +1 585 737-3463. -- Web http://www.husted.com/struts/ Mikkel Bruun wrote: it seems like there's a bunch of people in here using poolman therefore this mail I oaccasionally get this exception when running my system: NullPointerException at java.util.Hashtable.containsKey(Hashtable.java:299) at com.codestudio.util.JDBCPool.returnPooledStatement(Unknown Source) at com.codestudio.sql.PoolManPreparedStatement.close(Unknown Source) at com.codestudio.util.JDBCPool.closeStatement(Unknown Source) at com.codestudio.sql.PoolManConnection.clean(Unknown Source) at com.codestudio.util.JDBCPool.returnConnection(Unknown Source) at com.codestudio.util.JDBCPool.connectionClosed(Unknown Source) at com.codestudio.sql.PoolManConnection.sendCloseEvent(Unknown Source) at com.codestudio.sql.PoolManConnectionHandle.close(Unknown Source) at com.jbpb.blue.web.ValtechAction.closeConnection(ValtechAction.java:41 Its not fatal (the system continues running) but very unsettling... any suggestions?? thanks in advance mikkel -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Mapping in Struts-config.xml for a servlet
Hello, I have to make use of struts-config.xml. I should avoid using web.xml. Regards Arun [EMAIL PROTECTED] on 2002.02.14 14:53:29 Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc: (bcc: Arun Kumar N/Satyam) Subject Re: Mapping in Struts-config.xml for a servlet : To be able to call a com.somecompany.servlet.MySimpleServlet through the name SimpleServlet add the following to your web.xml servlet servlet-nameSimpleServlet/servlet-name servlet-classcom.somecompany.servlet.MySimpleServlet/servlet-class /servlet On Thu, 14 Feb 2002 08:54:38 +0530 [EMAIL PROTECTED] wrote: Hello, I want to call a simple servlet from an action class. What is the mapping I have to do in struts-config.xml file. Please look into this Regards Arun -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Get your firstname@lastname email at http://Nameplanet.com/?su -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Multiple struts-config.xml files?
The Struts 1.0 ActionServlet stores a number of elements in Application scope. // Publish our internal collections as necessary getServletContext().setAttribute(Action.FORM_BEANS_KEY, formBeans); getServletContext().setAttribute(Action.FORWARDS_KEY, forwards); getServletContext().setAttribute(Action.MAPPINGS_KEY, mappings); So, it's really not really threading issues (mispoke), but the last ActionServlet would win when it came to the Application scope elements. The custom tag extensions look to these to retrieving the ActionForwards and what not. Check for these statics in utils.RequestUtils, and you will see what I mean. Of course, if you are not using the custom tags, then it may not matter. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Java Web Development with Struts. -- Tel +1 585 737-3463. -- Web http://www.husted.com/struts/ Struts Newsgroup (@Basebeans.com) wrote: Subject: Re: Multiple struts-config.xml files? From: Jens Mander [EMAIL PROTECTED] === Which are the alterations required to allow struts 1.0 to permit multiple Action Servlets? Doesn't a container (e.g. Tomcat) generate separate instances for each action servlet which reads its own struts-config file and if so what kind of threading problems could occur? In my case I've been using an approach similar to what Michael describes without the RoleDispatcherServlet and I am worried about these threading problems you mention. Thanks, Ronaldo Ted Husted [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED]... Struts 1.0 isn't designed to permit multiple ActionServlets. Unless you've made some alterations, there may be threading problems. --cut -- Ted Husted, Husted dot Com, Fairport NY USA. -- Java Web Development with Struts. -- Tel +1 585 737-3463. -- Web http://www.husted.com/struts/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Mapping in Struts-config.xml for a servlet
Why would you want to avoid the web.xml ? On Thu, 14 Feb 2002 14:57:32 +0530 [EMAIL PROTECTED] wrote: Hello, I have to make use of struts-config.xml. I should avoid using web.xml. Regards Arun [EMAIL PROTECTED] on 2002.02.14 14:53:29 Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc: (bcc: Arun Kumar N/Satyam) Subject Re: Mapping in Struts-config.xml for a servlet : To be able to call a com.somecompany.servlet.MySimpleServlet through the name SimpleServlet add the following to your web.xml servlet servlet-nameSimpleServlet/servlet-name servlet-classcom.somecompany.servlet.MySimpleServlet/servlet-class /servlet On Thu, 14 Feb 2002 08:54:38 +0530 [EMAIL PROTECTED] wrote: Hello, I want to call a simple servlet from an action class. What is the mapping I have to do in struts-config.xml file. Please look into this Regards Arun -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Get your firstname@lastname email at http://Nameplanet.com/?su -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Get your firstname@lastname email at http://Nameplanet.com/?su -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Mapping in Struts-config.xml for a servlet
Hello, From one action class i have to move to another Servlet,instead of moving to JSP page. Regards Arun -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Form bean - null
you declare an action 'editStream' which you tell to use a form called 'MyForm' but afterwards you call an action called 'details'. Is the 'name=MyForm ' line in the declaration of 'details'action ?? On Thu, 14 Feb 2002 11:36:14 +0200 Konstantina Stamopoulou [EMAIL PROTECTED] wrote: Hello, I need to use a form bean in struts and this is the first time I'm doing that .So as newbie I feel I'm missing something basic. Can U help me? This is my case. I have my struts-config : form-beans form-bean name=MyForm type=provider.test.MyForm/ /form-beans actionpath=/editStream type=provider.test.MyFormAction name=MyForm scope=request validate=false forward name=success path=/streaming.jsp/ /action I have MyForm Bean with set and get methods and I have MyForm Action which just initializes my form: . if (form == null) { System.out.println(Form is null); form = new MyForm(); if (request.equals(mapping.getScope())) request.setAttribute(mapping.getAttribute(), form); else session.setAttribute(mapping.getAttribute(), form); } MyForm strmform = (MyForm) form; and finally my .jsp is the following: html:form action=/details tr font size=5 color=#A0 Destination IP Address : /font html:text property=ip1 size=3 / font color=#A0 . /font html:text property=ip2 size=3 / font color=#A0 . /font html:text property=ip3 size=3 / font color=#A0 . /font html:text property=ip4 size=3 / font color=#A0 . /font /tr tr html:text property=port size=3 / font color=#A0 /tr tr html:text property=lan size=3 / font color=#A0 /tr tr html:text property=autostart size=3 / font color=#A0 /tr /html:form When I callthis page I get a : javax.servlet.ServletException: Cannot retrieve definition for form bean null error, and I cannot fingure out what I 'm doing wrong. I would appriciated if U could provide me with any info regarding this problem. Thank U in advance, Konstantina -- Get your firstname@lastname email at http://Nameplanet.com/?su -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Mapping in Struts-config.xml for a servlet
Any URI will do. Struts doesn't handle the JSPs, another service does. You can forward to any URI in the application, regardless of what service or servlets handles it. [EMAIL PROTECTED] wrote: Hello, From one action class i have to move to another Servlet,instead of moving to JSP page. Regards Arun -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Ted Husted, Husted dot Com, Fairport NY USA. -- Java Web Development with Struts. -- Tel +1 585 737-3463. -- Web http://www.husted.com/struts/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Struts deploying on Weblogic SunOS 5.8
i'm always trying to deploy my struts application on Weblogic 5.1sp9 SunOS 5.8. Evrerytime i access a jsp page the following error occurs: Compilation of 'pathTOMyJSP.java' failed: _ pathToMyJSP.java:39: Superclass weblogic.servlet.jsp.JspBase of class jsp_servlet._myJSP not found. (No more information available, probably caused by another error pathToMyJSP.java:40: Interface weblogic.servlet.jsp.StaleIndicator of class jsp_servlet._myJSP not found. (No more information available, probably caused by another error) i have also tried to prepend the xerces.jar to weblogic class path but i got strange messages when starting weblogic (I posted the message on the struts developer mailing list for wrong ). Hope to get some reply Ivan. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Form bean - null
Hi Konstantina, How do you call your page? If you first call is not like .do, then the action will not be invoked, therefore the form bean is not initialized. Marcel -Original Message- From: Konstantina Stamopoulou [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 10:36 AM To: Struts Users Mailing List Subject: Form bean - null Hello, I need to use a form bean in struts and this is the first time I'm doing that .So as newbie I feel I'm missing something basic. Can U help me? This is my case. I have my struts-config : form-beans form-bean name=MyForm type=provider.test.MyForm/ /form-beans actionpath=/editStream type=provider.test.MyFormAction name=MyForm scope=request validate=false forward name=success path=/streaming.jsp/ /action I have MyForm Bean with set and get methods and I have MyForm Action which just initializes my form: . if (form == null) { System.out.println(Form is null); form = new MyForm(); if (request.equals(mapping.getScope())) request.setAttribute(mapping.getAttribute(), form); else session.setAttribute(mapping.getAttribute(), form); } MyForm strmform = (MyForm) form; and finally my .jsp is the following: html:form action=/details tr font size=5 color=#A0 Destination IP Address : /font html:text property=ip1 size=3 / font color=#A0 . /font html:text property=ip2 size=3 / font color=#A0 . /font html:text property=ip3 size=3 / font color=#A0 . /font html:text property=ip4 size=3 / font color=#A0 . /font /tr tr html:text property=port size=3 / font color=#A0 /tr tr html:text property=lan size=3 / font color=#A0 /tr tr html:text property=autostart size=3 / font color=#A0 /tr /html:form When I callthis page I get a : javax.servlet.ServletException: Cannot retrieve definition for form bean null error, and I cannot fingure out what I 'm doing wrong. I would appriciated if U could provide me with any info regarding this problem. Thank U in advance, Konstantina -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: help populating an array before perform action
- Original Message - From: Ronald Haring [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 11:07 AM Subject: help populating an array before perform action Hi all, request.setAttribute(formBean, formBean); maybe it's something you don't like: request.getSession().setAttribute((formBean, formBean); Bye Ivan. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: No getter method for property... but present
i had the same message. Add a beanInfo == - Original Message - From: João Paulo G. Batistella [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, February 05, 2002 4:01 PM Subject: Re: No getter method for property... but present You are using List for get and String for set method. You should use the same type for both methods. JP public void setEconomicActivities(String newEconomicActivities) public List getEconomicActivities() public void setDomains(String newDomains) public List getDomains() Tom Goemaes wrote: Hi, in my bean i have among others: public void setEconomicActivities(String newEconomicActivities) public List getEconomicActivities() public void setDomains(String newDomains) public List getDomains() Both setters perform a tokenizer operation on the provided string, and both getters return the result of that operation. When i iterate over the domains there is no problem, but when i try to do the same... the same way... for economic activities i get a: 'no getter method for property ... in bean ...' logic:notEmpty name=experience property=domains scope=page logic:iterate id=activityDomain name=experience property=domains scope=page type=blabla bean:write name=activityDomain property=description scope=page/ /logic:iterate /logic:notEmpty logic:notEmpty name=experience property=economicActivities scope=page logic:iterate id=economicActivity name=experience property=economicActivities scope=page type=blabla bean:write name=economicActivity property=description scope=page/ /logic:iterate /logic:notEmpty any ideas what could be the cause of this? When i rename the setter method for economicActivities to economicActivity the exception is not thrown... Is it because the setter get a String and the getter return a list ? but howcome then that the domains getter and setter work well and do practically the same thing? any hints or try-outs ? Tom. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: help populating an array before perform action
Hi all, request.setAttribute(formBean, formBean); maybe it's something you don't like: request.getSession().setAttribute((formBean, formBean); Ouch, well if thats the only way to do it, then thats the way to do it thx Ivan Furore B.V. Rijswijkstraat 175-8 Postbus 9204 1006 AE Amsterdam tel. (020) 346 71 71 fax. (020) 346 71 77 --- The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer ---
ActionServlet return a pdf document
Hello, I am trying to generate a PDF document on the fly based on dynamic jsp generation comming from BroadVision. I am making use of an struts action class,which genreates the required PDf file.When i try to open the PDF file I get the error as There was an error opening this document.Could not repair this file If i run the same application in Tomcat it works fine. This is by java code. public class PDF extends Action { public ActionForward perform(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws IOException, ServletException { try { Document document = new Document(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); PdfWriter.getInstance(document, baos); document.open(); document.add(new Paragraph(Hello World)); document.close(); response.setContentType(application/pdf); response.setContentLength(baos.size()); ServletOutputStream out = response.getOutputStream(); baos.writeTo(out); out.flush(); } catch (Exception e2) { System.out.println(Error in +getClass().getName()+\n+e2); } return null; } }//end of class Please look into this matter. Thanks regards Arun -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Character Encoding wrong just for ApplicationResources!
Hertzel, The property files get loaded using ISO-8859-1 Encoding but they understand unicode escapes. Convert your file using the java tool (jdk/bin) 'native2ascii' and that should load the strings into the JVM correctly. The only other possible problem occurs in some Containers (see Tagunov's doc below for more detail) - The %@ page contentType=text/html; charset=UTF-8 % gets converted into a setContentType() call on the response object, this has to occur before the output writer is retrieved from the pageContext, otherwise the default character encoding is used. Some (web logic 6 amongst others) set the content type after the writer is called thus rendering the @page contentType directive useless! Anton Tagunov's document is excellent and very comprehensive. Hope this helps, Chris. -Original Message- From: Hertzel Karbasi - OPTinity eBusiness Solutions [mailto:[EMAIL PROTECTED]] Sent: 14 February 2002 08:40 To: Struts Users Mailing List Cc: [EMAIL PROTECTED] Subject: Re: Character Encoding wrong just for ApplicationResources! Thanks for your response. But I have already saved the ApplicationResource file in Unicode but the same results!! I have tried saving the file in UTF-8 too but again the same results. Any suggestions? Thanks Hertzel - Original Message - From: Louis Leung [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 12:15 AM Subject: Re: Character Encoding wrong just for ApplicationResources! or you can covert your properties file strings from native to unicode using this method return new String(oldString.getBytes(), encoding); where encoding is the native encoding u used in your properties file more 'bout charset encoding/decoding on this page : http://tagunov.newmail.ru/i18n/i18n.html Hertzel Karbasi - OPTinity eBusiness Solutions wrote: Hello All I have added the following to JSP files META http-equiv=Content-Type content=text/html, charset=UTF-8 %@ page contentType=text/html; charset=UTF-8 % html:html locale=true Change the locale in an Action to iw_IL And get: Constant strings inserted in JSP in Hebrew are OK. Just the Strings (html:message coming from Applicationresource are shown as ?? I have checked the messages in debug and found out that they come as from the resource. The constant string inserted in the JSP in Hebrew just to check the browser and they have been displayed right! Any assistance will be appreciated. Thanks Hertzel -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Form bean - null
Well, Actually my error was that I was associating MyForm with the wrong action. Thank U for pointing that out. Konstantina On Thu, 14 Feb 2002 11:36:14 +0200 Konstantina Stamopoulou [EMAIL PROTECTED] wrote: Hello, I need to use a form bean in struts and this is the first time I'm doing that .So as newbie I feel I'm missing something basic. Can U help me? This is my case. I have my struts-config : form-beans form-bean name=MyForm type=provider.test.MyForm/ /form-beans actionpath=/editStream type=provider.test.MyFormAction name=MyForm scope=request validate=false forward name=success path=/streaming.jsp/ /action I have MyForm Bean with set and get methods and I have MyForm Action which just initializes my form: . if (form == null) { System.out.println(Form is null); form = new MyForm(); if (request.equals(mapping.getScope())) request.setAttribute(mapping.getAttribute(), form); else session.setAttribute(mapping.getAttribute(), form); } MyForm strmform = (MyForm) form; and finally my .jsp is the following: html:form action=/details tr font size=5 color=#A0 Destination IP Address : /font html:text property=ip1 size=3 / font color=#A0 . /font html:text property=ip2 size=3 / font color=#A0 . /font html:text property=ip3 size=3 / font color=#A0 . /font html:text property=ip4 size=3 / font color=#A0 . /font /tr tr html:text property=port size=3 / font color=#A0 /tr tr html:text property=lan size=3 / font color=#A0 /tr tr html:text property=autostart size=3 / font color=#A0 /tr /html:form When I callthis page I get a : javax.servlet.ServletException: Cannot retrieve definition for form bean null error, and I cannot fingure out what I 'm doing wrong. I would appriciated if U could provide me with any info regarding this problem. Thank U in advance, Konstantina -- Get your firstname@lastname email at http://Nameplanet.com/?su -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
logic:iterate question
hello, i have a problem on one of my views with a logic:iterate tag. i have an action that fetches news headlines from a database (headline,headlineID) and stores them in a bean (headlines-Arraylist,headlinedID-Vector) which is appended to request/session. On the view i want to iterate through the Arraylist with the headlines which basically works fine. but i need to create links like this: a href=ViewHeadlineAction.do?headlineID=XXYZ/a how would i use the iterate tag? do i have to use the nested tag? (i am currently using struts 1.0.2) i dont want to use any java code in my view, only tags... thanks, oli -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: isTokenValid(request) is always returning false
Wild guess here. Can you look at what's in your request parameters? Maybe - you call saveToken twice without calling isTokenValid between. So when you test isTokenValid there are 2 tokens in the request parms struts checks against the 1st one? As I say a wild guess. --- Antony Stace [EMAIL PROTECTED] wrote: saveToken() is in the action.equals(checkData) section of code, isTokenValid() is in the action.equals(saveInDatabase) section of code. The first time the user accesses this action they hit the checkData section, which has the saveToken, they do not go into the saveInDatabase section. The screen which is produced does not have any form in it(is this a problem). The user hits the save button and the same action.peform method is called, only this time action=saveInDatabase if (action.equals(saveInDatabase) isTokenValid(request) ) { } section is hopefully run. But it isn't since isTokenValid(request) is evaluating to false even though in the previous time in this function called saveToken(request). Why is the isTokenValid(request) evaluating to false even though I previously called saveToken(request) Thoughs/ideas anyone Cheers Tony On Wed, 13 Feb 2002 06:26:55 -0800 (PST) Keith [EMAIL PROTECTED] wrote: is your code in the right place? In the order you have it the token isn't in the request. at bottom of your page saveToken(request); // - I think this writes a hidden field in your jsp. // which ends up in the request after form is submitted. // send your page at top of page if ( isTokenValid(request)) { tests the token in the request. --- Antony Stace [EMAIL PROTECTED] wrote: Thanks for the reply Mark. Well...that piece of code was just a test snippet. I have a problem in an Action - TestAction (with action = checkData), in TestAction.perform() the code which handles action=checkData I have if (action.equals(checkData)) { saveToken(request); //populate beans...etc } this populates a number of beans and these are used to display information in a jsp page. This page is just a confirmation screen for data which was entered in the previous screen. When the user hits the accept button on this page they go to TestAction(but with action=saveInDatabase). In TestAction.perform() for action=saveInDatabase I have if ( action.equals(saveInDatabase) isTokenValid(request)) { //save in database resetToken(request); } but the trouble is I always have isTokenValid(request) evaluating to false, so this part is always skipped so the data is not saved in the database :(. Cheers Tony On Wed, 13 Feb 2002 08:04:07 -0500 Galbreath, Mark [EMAIL PROTECTED] wrote: A false parameter? :-) Well, for starters, what are you passing into isTokenValid() and what is the method testing for? I am passing into isTokenValid() request which is one of the Action.perform() parameters. Cheers! Mark Try before you cry: http://www.mail-archive.com/struts-user%40jakarta.apache.org/ -Original Message- From: Antony Stace [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 2:37 AM What would cause saveToken(request); if ( isTokenValid(request)) { System.out.println(isTokenValid(request) true); } else { System.out.println(isTokenValid(request) false); } To always print isTokenValid(request) false. I am always getting the value of isTokenValid(request) being equal to false. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Cheers Tony__ - _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Cheers Tony¡£ - _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings!
Re: logic:iterate question
Hi , From what I understand you want to create links for each headline and pass the head line as a parameter. So inside the logic:iterate tag U should put : logic:iterate. jsp:useBean id=info class=java.util.HashMap/ %info.put(HeadLineID, X); % html:link page=/details.do name=info Headline /html:link /logic:iterate U can replace the one line of code with jsp:setProperty of the bean info It worked for me. Konstantina ---Original Message - From: Oliver Kiessler [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 12:58 PM Subject: logic:iterate question hello, i have a problem on one of my views with a logic:iterate tag. i have an action that fetches news headlines from a database (headline,headlineID) and stores them in a bean (headlines-Arraylist,headlinedID-Vector) which is appended to request/session. On the view i want to iterate through the Arraylist with the headlines which basically works fine. but i need to create links like this: a href=ViewHeadlineAction.do?headlineID=XXYZ/a how would i use the iterate tag? do i have to use the nested tag? (i am currently using struts 1.0.2) i dont want to use any java code in my view, only tags... thanks, oli -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: logic:iterate question
links like this: a href=ViewHeadlineAction.do?headlineID=XXYZ/a supposing the logic:iterate id paramenter is set to element It should be something like this html:link page=ViewHeadlineAction.do paramName=element paramId=headlineID paramPropery=getterMethodWhoReturnsX instead of the static a/a checks this document http://jakarta.apache.org/struts/struts-html.html for html:link reference doc. Hope this helps. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: logic:iterate question
This should work ... ( use bean:write to set the value of the parameter ... ) logic:iterate id=headline name=headlines scope=session a href=ViewHeadLineAction.do?headLineId=bean:write name=headline property=headlineID/ View Headline /a /logic:iterate On 14 Feb 2002 11:58:39 +0100 Oliver Kiessler [EMAIL PROTECTED] wrote: hello, i have a problem on one of my views with a logic:iterate tag. i have an action that fetches news headlines from a database (headline,headlineID) and stores them in a bean (headlines-Arraylist,headlinedID-Vector) which is appended to request/session. On the view i want to iterate through the Arraylist with the headlines which basically works fine. but i need to create links like this: a href=ViewHeadlineAction.do?headlineID=XXYZ/a how would i use the iterate tag? do i have to use the nested tag? (i am currently using struts 1.0.2) i dont want to use any java code in my view, only tags... thanks, oli -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Get your firstname@lastname email at http://Nameplanet.com/?su -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: logic:iterate question
thanks! thats it. now it works... ;) oli Am Don, 2002-02-14 um 12.13 schrieb Ivan Siviero: links like this: a href=ViewHeadlineAction.do?headlineID=XXYZ/a supposing the logic:iterate id paramenter is set to element It should be something like this html:link page=ViewHeadlineAction.do paramName=element paramId=headlineID paramPropery=getterMethodWhoReturnsX instead of the static a/a checks this document http://jakarta.apache.org/struts/struts-html.html for html:link reference doc. Hope this helps. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- mailto: [EMAIL PROTECTED] web: http://www.linustar.de gnupg key: http://www.linustar.de/pgp/kiessler.gpg icq: 136832122 --- The more I question the origin and meaning of our existence, the less I care. And the less I care, the more I question myself. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Multiple file upload not possible due to MultiPartRequestHandler limitation?
File upload of a single file with Struts 1.0.2 seems to work OK. But it fails for multiple files. Note: I mean 1 INPUT TYPE=FILE tag where the user selects *multiple* files (Opera and IE allow this), not multiple INPUT TYPE=FILE tags! The MultipartRequestHandler doesn't seem to support this, since it getFileElements() returns FormFiles in a hashtable, and cannot therefore handle more than 1 FormFile for each input name. The only way around this is to put multiple INPUT tags on the page, whicih is a problem when I want to allow the user to upload a lot of (small) files. If I'm not correct, how does one handle this? TIA Marcel Maré -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
File upload example in nightly build is broken
The struts file upload example (struts-upload.war) in the nightly build gives the following exception om TC 4.0.1 on Win2K SP2: javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE Does anybody know what's wrong? Somebody suggested that putting xerces.jar in the webapps' lib directory solved it. But is doesn't in my case. TIA Marcel Maré -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Netscape6.1 not displaying text field
Let me preface this email by saying that I don't think this problem is Struts related, although I am using Struts for this project. I have searched the archives and have spent the last 12 hours working on this problem. I feel kind of crappy for posting this especially with the recent Traffic thread, but if any one can help me solve this problem surely someone on this list can. Scenario: One JSP page with a form that has 3 text fields and a submit button. The form submits the request to Action where the request is processed, data is placed in the session, and the output is redirected (not forwarded) back to the same page. The fields are populated with data and the browser renders their respective values. More specifically field1 and field2 are for data entry, and field3 is for data display. I use bean:write .../ to pull the data from the session and display it in field3. Everything works fine in IE, but in Netscape6.1, field3 does not display its value, although when I view the source, the value attribute is populated with the data. No, there are no funky characters in the output and I use double quotes for all attributes. As a double check I duplicated the bean:write / used to retrieve the value from the session for field3 and moved it outside of an input text field and the value displays as expected. I then tried rendering the value in a textarea and got the same behavior as that of field3. Now, if the data happens to exist in the session (as a result of another Action) when the page is displayed, then the data in field3 renders as expected. If I copy the the raw HTML from the source to another page, and view it, then field3 also renders as expected. I would sure like to know if anyone else has run into this problem or if you have any ideas. robert -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: logic:iterate question
I have a similiar question, but this time with a button Every row will have a show action. With a link there is no problem (using the method described) but with a button I have a problem since I cant replace the onclick event with a parameter. html:button onclick=go('show',bean:write name=loop value=id/)/ this should become input type=button onclick=go(show,1) Gr Ronald -Original Message- From: Oliver Kiessler [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 12:21 PM To: Struts Users Mailing List Subject: Re: logic:iterate question thanks! thats it. now it works... ;) oli Am Don, 2002-02-14 um 12.13 schrieb Ivan Siviero: links like this: a href=ViewHeadlineAction.do?headlineID=XXYZ/a supposing the logic:iterate id paramenter is set to element It should be something like this html:link page=ViewHeadlineAction.do paramName=element paramId=headlineID paramPropery=getterMethodWhoReturnsX instead of the static a/a checks this document http://jakarta.apache.org/struts/struts-html.html for html:link reference doc. Hope this helps. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- mailto: [EMAIL PROTECTED] web: http://www.linustar.de gnupg key: http://www.linustar.de/pgp/kiessler.gpg icq: 136832122 --- The more I question the origin and meaning of our existence, the less I care. And the less I care, the more I question myself. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] Furore B.V. Rijswijkstraat 175-8 Postbus 9204 1006 AE Amsterdam tel. (020) 346 71 71 fax. (020) 346 71 77 --- The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer ---
RE: logic:iterate question
can't you create a form around each button ?? On Thu, 14 Feb 2002 12:29:34 +0100 Ronald Haring [EMAIL PROTECTED] wrote: I have a similiar question, but this time with a button Every row will have a show action. With a link there is no problem (using the method described) but with a button I have a problem since I cant replace the onclick event with a parameter. html:button onclick=go('show',bean:write name=loop value=id/)/ this should become input type=button onclick=go(show,1) Gr Ronald -Original Message- From: Oliver Kiessler [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 12:21 PM To: Struts Users Mailing List Subject: Re: logic:iterate question thanks! thats it. now it works... ;) oli Am Don, 2002-02-14 um 12.13 schrieb Ivan Siviero: links like this: a href=ViewHeadlineAction.do?headlineID=XXYZ/a supposing the logic:iterate id paramenter is set to element It should be something like this html:link page=ViewHeadlineAction.do paramName=element paramId=headlineID paramPropery=getterMethodWhoReturnsX instead of the static a/a checks this document http://jakarta.apache.org/struts/struts-html.html for html:link reference doc. Hope this helps. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- mailto: [EMAIL PROTECTED] web: http://www.linustar.de gnupg key: http://www.linustar.de/pgp/kiessler.gpg icq: 136832122 --- The more I question the origin and meaning of our existence, the less I care. And the less I care, the more I question myself. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] Furore B.V. Rijswijkstraat 175-8 Postbus 9204 1006 AE Amsterdam tel. (020) 346 71 71 fax. (020) 346 71 77 --- The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer --- -- Get your firstname@lastname email at http://Nameplanet.com/?su -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: logic:iterate question
can't you create a form around each button ?? I can do that I suppose, but not sure whether old netscape users like multiple forms. Other problem is that if you define forms within a table the table row will become larger, but thx for that solution Gr Ronald Furore B.V. Rijswijkstraat 175-8 Postbus 9204 1006 AE Amsterdam tel. (020) 346 71 71 fax. (020) 346 71 77 --- The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer ---
Re: changing Built in Validation Error Message
You can just set them to a blank string in ApplicationResources.properties. But But you must want to change them at run time. 1 - make a special version of the errors tag that gets the overridden strings from the request. 2 - Use the new messages tag to display them logic tags to control theheader/footer. --- Mattos, John [EMAIL PROTECTED] wrote: I seem to have got it working, except that the error message reads... VALIDATION ERROR you must check the following. I see that it's getting it from errors.footer and errors.header in the resource file. I'd like to override that behavior temporarily, and just display the message Is there some sort of Message service that I can use, analogous to the Error service, or can I temporarily change the errors.header and errors.footer? John Mattos Sr. Developer and Architect iNDEMAND 345 Hudson St. 16th Floor New York, New York 10014 -Original Message- From: Mattos, John [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 1:09 PM To: '[EMAIL PROTECTED]' Subject: Passing Action Errors from one perform() method to another perfor m() method - Expert help? Hi all. I'm trying to do the following. In an Action.perform() method, I'm adding an ActionErrors object to the request as follows // Snippet from an Action.perform() method ActionErrors errors = new ActionErrors (); errors.add(Processed, new ActionError(Processing Done)); saveErrors(request, errors); return new ActionForward(/suspends.do); // End of first perform() snippet Notice that I'm forwarding to a .do, which means I'm in another perform() method in the SECOND perform() method, I want to do some preprocessing (get stuff from a database) then forward to a JSP, and INLCUDE the actionErrors object from the first perform() method. Here's how I'm doing that now // snipped from second perform() method, mapped to suspends.do ActionErrors errors = new ActionErrors(); errors= (ActionErrors)request.getAttribute(Processed); saveErrors (request, errors); return new ActionForward(/invoicing/suspendsSummary.jsp); // End of second perform() snippet am I going about this in the wrong way? Is this even possible? basically, I want to pass a message back to the jsp that is really a status message (as in.. I'm done processing) thoughts? John Mattos Sr. Developer and Architect iNDEMAND 345 Hudson St. 16th Floor New York, New York 10014 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: How do I leverage the struts approach within an EJB environment?
LOL! Thanks for the chuckle this early in the morning! Mark -Original Message- From: Jonathan Gibbons [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 3:43 AM Why do all this? Basically you are using an industry standard RPC mechanism to a middle tier (ie the EJB remote stuff with JNDI lookup). You are decoupling the GUI from the data manipulation which theoretically gives you OO code reuse (like hell, but someone believes this stuff). You do gain scalability advantages (kind of, but lets not think too hard about that eh). Jonathan -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Confused over check boxes
Why not monitor the checkbox(es) with a JavaScript onClick() method and set a hidden variable that would be passed to your ActionForm? Cheers! Mark -- Try before you cry: http://www.mail-archive.com/struts-user%40jakarta.apache.org/ -Original Message- From: Nick Thomson [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 3:33 AM To: Struts Users Mailing List Subject: Re: Confused over check boxes Try thinking of it this way. For every JSP page 2 actions take place. The first action is used to populate the form bean and then control is passed to the JSP page. During this phase you can ignore reset and set your properties as you need them. The 2nd action is used to process the user's responses. This is where the reset() method is important to you. Per the HTML spec., unchecked boxes are not placed in the parameter list. Therefore, if the reset method did not uncheck your checkbox for you, then you would not have any way of determining if a user had uncheck any boxes. Hope this helps. - Original Message - From: Ian Beaumont [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, February 13, 2002 10:41 AM Subject: Confused over check boxes I've got a checkbox on a page. It's initial state needs to be checked. In my form I have a boolean value for the check box. It fails to detect correctly if the check box is set. In my reset method I set the check box to true (as this is the initial state), but the help says WARNING: In order to correctly recognize unchecked checkboxes, the ActionForm bean associated with this form must include a statement setting the corresponding boolean property to false in the reset() method. How am I supposed to deal with this situation? Thanks Ian Beaumont -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Why no indexed attribute defined in struts-html.tld?
I think I need the indexed attribute but it is'nt there ... So that's a problem ... On Thu, 14 Feb 2002 07:07:22 -0500 Galbreath, Mark [EMAIL PROTECTED] wrote: How could it be a problem if it never worked? Sounds like a documentation error. Cheers! Mark -- Try before you cry: http://www.mail-archive.com/struts-user%40jakarta.apache.org/ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 4:14 AM I'm having the same problem ... No one to help ??? On Wed, 13 Feb 2002 16:13:31 -0800 Liu, Xin [EMAIL PROTECTED] wrote: Hi, From Struts on-line doc, I saw the new attribute indexed is added to some html tags. But the JSP engine told me attribute indexed is invalid. After checking in struts-html.tld, I could not find this attribute: indexed in any element of struts-html.tld. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Get your firstname@lastname email at http://Nameplanet.com/?su -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: ActionServlet return a pdf document
Where did PdfWriter() come from? Cheers! Mark -- Try before you cry: http://www.mail-archive.com/struts-user%40jakarta.apache.org/ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 5:26 AM file.When i try to open the PDF file I get the error as There was an error opening this document.Could not repair this file public class PDF extends Action { public ActionForward perform(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws IOException, ServletException { try { Document document = new Document(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); PdfWriter.getInstance(document, baos); document.open(); document.add(new Paragraph(Hello World)); document.close(); response.setContentType(application/pdf); response.setContentLength(baos.size()); ServletOutputStream out = response.getOutputStream(); baos.writeTo(out); out.flush(); } catch (Exception e2) { System.out.println(Error in +getClass().getName()+\n+e2); } return null; } } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: ActionServlet return a pdf document
Hello, Here I use Itext tool to create pdf files. Its a Java library. I use iText.jar to generate the PDF files. Galbreath, Mark [EMAIL PROTECTED] on 2002.02.14 17:52:38 Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] cc: (bcc: Arun Kumar N/Satyam) Subject RE: ActionServlet return a pdf document : Where did PdfWriter() come from? Cheers! Mark -- Try before you cry: http://www.mail-archive.com/struts-user%40jakarta.apache.org/ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 5:26 AM file.When i try to open the PDF file I get the error as There was an error opening this document.Could not repair this file public class PDF extends Action { public ActionForward perform(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws IOException, ServletException { try { Document document = new Document(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); PdfWriter.getInstance(document, baos); document.open(); document.add(new Paragraph(Hello World)); document.close(); response.setContentType(application/pdf); response.setContentLength(baos.size()); ServletOutputStream out = response.getOutputStream(); baos.writeTo(out); out.flush(); } catch (Exception e2) { System.out.println(Error in +getClass().getName()+\n+e2); } return null; } } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Why no indexed attribute defined in struts-html.tld?
Well, perhaps Ted will address this issue sometime today. In the meantime, you can always write your own custom tag based on the HTML tags' source code that you need (the beauty of open-source). Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 7:22 AM I think I need the indexed attribute but it is'nt there ... So that's a problem ... On Thu, 14 Feb 2002 07:07:22 -0500 Galbreath, Mark [EMAIL PROTECTED] wrote: How could it be a problem if it never worked? Sounds like a documentation error. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 4:14 AM I'm having the same problem ... No one to help ??? On Wed, 13 Feb 2002 16:13:31 -0800 Liu, Xin [EMAIL PROTECTED] wrote: From Struts on-line doc, I saw the new attribute indexed is added to some html tags. But the JSP engine told me attribute indexed is invalid. After checking -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Want to check user is logged in every page server]
Sridhar, You are absolutely correct. Sorry about that. I had a old version of my code at home. Sorry Jeff -Original Message- From: Sridhar Kumanduri [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 10:57 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: Want to check user is logged in every page server] Hi Jeff, In your code, you keep the token in the ServletContext rather than in the user session. (String)getServletContext().getAttribute(SeamConstants.LOGGEDINVAR); Isn't the ServletContext shared by all the users in the application? Regards Sridhar Kumanduri --- [EMAIL PROTECTED] wrote: This uses a constant to determine if you wanted login checking to be on or off. Sometimes during development you might not want that requirement. Jeff Krueger public class TradeController extends PersistentSessionController { public void init() throws ServletException { super.init(); } protected boolean processPreprocess(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { boolean status = super.processPreprocess(request, response); // Check for login if (status SeamConstants.LOGIN_ACTIVE) { // process the uri String requri = request.getRequestURI(); int p1 = requri.lastIndexOf(/); String page = requri.substring(p1+1); if(!(SeamConstants.LOGIN_DO.equals(page))) { // not the logion page - loginScreen.trade if(!(SeamConstants.LOGIN_SUBMIT.equals(page))) { // not the target of the login post - login String valid = (String)getServletContext().getAttribute(SeamConstants.LOGGEDINVAR); if((valid == null) || (!(valid.equals(SeamConstants.LOGGEDINVAL { // the user has not logged in, redirect to the login url RequestDispatcher disp = getServletContext().getRequestDispatcher(SeamConstants.LOGGIN_DISPATCH); disp.forward(request,response); return false; } } } } return status; } } -Original Message- From: Thinh Doan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 10:21 AM To: Struts Users Mailing List Subject: RE: Want to check user is logged in every page server] Regis, Would you please give some code example on how you extended the ActionServlet on how you did it? Thanks, Thinh -Original Message- From: Rigis Melo [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 11:22 AM To: 'Struts Users Mailing List' Subject: RES: Want to check user is logged in every page server] Hello Antony, I extend the ActionServlet and Write some code to test if the user is logged and if He has permission to acess a page. It's very flexibile because is not only a test of login or not login. I can test, for example, if user XYZ has permission to acess some URL after He is logged in. Rigis Melo SoftSite Tecnologia -Mensagem original- De: Antony Stace [mailto:[EMAIL PROTECTED]] Enviada em: domingo, 27 de janeiro de 2002 23:25 Para: [EMAIL PROTECTED] Assunto: AW: Want to check user is logged in every page server] Hi In the struts example the method used( as many people have pointed out) to check that the person requesting the page is logged on is to have at the top of each jsp a tag like custom:checkLogonTag/ This tag should check to see if some sort of bean is present - this bean indicates the user has logged on successfully - (method 1). Do I need to do anything else or is this the safest way to ensure a user is loged on before serving them the requested page. Question, is there any point of having some sort of database record to indicate a user has loggon on and checking with that database record as well as the bean in (method 1) that the user is logged on? Cheers Tony You can do this with a custom tag custom:checkLogonTag/ of course you also need to implement this tag. this is what actually does the job: public int doEndTag() throws JspException { // Is there a valid user logged on? boolean valid = false; HttpSession session = pageContext.getSession(); if ((session != null) (session.getAttribute(name) != null)) valid = true; // Forward control based on the results if (valid) return (EVAL_PAGE); else { try { pageContext.forward(page); } catch (Exception e) { throw new JspException(e.toString()); } return (SKIP_PAGE); } } Take a look at the example Mailserver application that comes with Struts. -Ursprungliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Gesendet: Dienstag, 20. November 2001 10:42
RE: ActionServlet return a pdf document
Then I suspect that therein your problem lies. Cheers! Mark -- Try before you cry: http://www.mail-archive.com/struts-user%40jakarta.apache.org/ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 7:31 AM Here I use Itext tool to create pdf files. Its a Java library. I use iText.jar to generate the PDF files. Galbreath, Mark [EMAIL PROTECTED] on 2002.02.14 17:52:38 Where did PdfWriter() come from? Cheers! Mark -- Try before you cry: http://www.mail-archive.com/struts-user%40jakarta.apache.org/ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 5:26 AM file.When i try to open the PDF file I get the error as There was an error opening this document.Could not repair this file public class PDF extends Action { public ActionForward perform(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws IOException, ServletException { try { Document document = new Document(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); PdfWriter.getInstance(document, baos); document.open(); document.add(new Paragraph(Hello World)); document.close(); response.setContentType(application/pdf); response.setContentLength(baos.size()); ServletOutputStream out = response.getOutputStream(); baos.writeTo(out); out.flush(); } catch (Exception e2) { System.out.println(Error in +getClass().getName()+\n+e2); } return null; } } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Help forwarding from one site to another.
Hello all, Upon a successful response from an action class I would like to forward to a different site. I have tried adding forward name=success path=http://www.slashdot.org/; / to my struts-config.xml, but it fails. Is there a nice way of achieving this? Thanks. Stephen. --- Copyright material and/or confidential and/or privileged information may be contained in this e-mail and any attached documents. The material and information is intended for the use of the intended addressee only. If you are not the intended addressee, or the person responsible for delivering it to the intended addressee, you may not copy, disclose, distribute, disseminate or deliver it to anyone else or use it in any unauthorised manner or take or omit to take any action in reliance on it. To do so is prohibited and may be unlawful. The views expressed in this e-mail may not be official policy but the personal views of the originator. If you receive this e-mail in error, please advise the sender immediately by using the reply facility in your e-mail software, or contact [EMAIL PROTECTED] Please also delete this e-mail and all documents attached immediately. Many thanks for your co-operation. BMW Financial Services (GB) Limited is registered in England and Wales under company number 01288537. Registered Offices : Europa House, Bartley Way, Hook, Hants, RG27 9UF -- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
AW: Help forwarding from one site to another.
i would insert in the action code response.sendRedirect(www.slashdot.org); cause struts takes all addresses in the struts-config.xml as they are in the same context. This would be the easiest way to implement it. Maybe you can also achieve it with the RequestUtils of Struts, but that i don*t know Oliver -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 14. Februar 2002 14:33 An: [EMAIL PROTECTED] Betreff: Help forwarding from one site to another. Hello all, Upon a successful response from an action class I would like to forward to a different site. I have tried adding forward name=success path=http://www.slashdot.org/; / to my struts-config.xml, but it fails. Is there a nice way of achieving this? Thanks. Stephen. --- Copyright material and/or confidential and/or privileged information may be contained in this e-mail and any attached documents. The material and information is intended for the use of the intended addressee only. If you are not the intended addressee, or the person responsible for delivering it to the intended addressee, you may not copy, disclose, distribute, disseminate or deliver it to anyone else or use it in any unauthorised manner or take or omit to take any action in reliance on it. To do so is prohibited and may be unlawful. The views expressed in this e-mail may not be official policy but the personal views of the originator. If you receive this e-mail in error, please advise the sender immediately by using the reply facility in your e-mail software, or contact [EMAIL PROTECTED] Please also delete this e-mail and all documents attached immediately. Many thanks for your co-operation. BMW Financial Services (GB) Limited is registered in England and Wales under company number 01288537. Registered Offices : Europa House, Bartley Way, Hook, Hants, RG27 9UF -- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Help forwarding from one site to another.
Thanks for that, but the issue is that it is hard coded and doesn't allow the flexibility the forward tag allows. This flexibility would be advantageous for a pluggable corporate network. Stephen. -Original Message- From: Oliver Reflé [mailto:[EMAIL PROTECTED]] Sent: 14 February 2002 13:39 To: Struts Users Mailing List Subject: AW: Help forwarding from one site to another. i would insert in the action code response.sendRedirect(www.slashdot.org); cause struts takes all addresses in the struts-config.xml as they are in the same context. This would be the easiest way to implement it. Maybe you can also achieve it with the RequestUtils of Struts, but that i don*t know Oliver -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 14. Februar 2002 14:33 An: [EMAIL PROTECTED] Betreff: Help forwarding from one site to another. Hello all, Upon a successful response from an action class I would like to forward to a different site. I have tried adding forward name=success path=http://www.slashdot.org/; / to my struts-config.xml, but it fails. Is there a nice way of achieving this? Thanks. Stephen. --- Copyright material and/or confidential and/or privileged information may be contained in this e-mail and any attached documents. The material and information is intended for the use of the intended addressee only. If you are not the intended addressee, or the person responsible for delivering it to the intended addressee, you may not copy, disclose, distribute, disseminate or deliver it to anyone else or use it in any unauthorised manner or take or omit to take any action in reliance on it. To do so is prohibited and may be unlawful. The views expressed in this e-mail may not be official policy but the personal views of the originator. If you receive this e-mail in error, please advise the sender immediately by using the reply facility in your e-mail software, or contact [EMAIL PROTECTED] Please also delete this e-mail and all documents attached immediately. Many thanks for your co-operation. BMW Financial Services (GB) Limited is registered in England and Wales under company number 01288537. Registered Offices : Europa House, Bartley Way, Hook, Hants, RG27 9UF -- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: A good database pool?
Hi, is this part of the expresso package. IE do I download the whole expresso package or is this a separate add on that can be used without expresso. I went to the site and all I can find is the whole package. Thanks Alex -Original Message- From: Sandra Cann [mailto:[EMAIL PROTECTED]] Sent: February 13, 2002 12:02 AM To: Struts Users Mailing List Subject: RE: A good database pool? Suggest you try the Expresso Connection pooling at www.jcorporate.com as it is supported. Btw it is also open source. -Original Message- From: Alex Colic [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 12, 2002 4:58 PM To: Struts Subject: A good database pool? Hi, I have a couple of struts apps that use a lot of database connections. I have been moving them over to use a connection pool manager. I have found a couple of free ones e.g.. Poolman, jdbcpool but neither are being supported. Can someone suggest another database pool manger. I don't care if I have to pay for it I just want to make sure that it works and that there will be continued development on it. Thanks Alex -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
href:link ?
Hello, I am new to Struts and I hope someone can help with this problem: I am using the iterate tag to disply some obejects (like this logic:iterate id=mybean name=MyForm property=mybeans and I can write the data like bean:write name=mybean property=x/ etc. ) For each iteration i want to create a link to a servlet. The link will contain values from the object so each link will differ from the other links, like /servletname?x1=valuex1y1=valuey1 /servletname?x2=valuex2y2=valuey2 /servletname?x3=valuex3y3=valuey3 Each link string will be created by calling a 'getRequestString(x,y)' in the corresponding form bean (MyForm). How do a make this link? I want to do something like html:link page=MyForm.getRequestString( bean:write name=mybean property=x/, bean:write name=mybean property=y/) /html:link I hope you understand what I would like to do! Thanks, Ulrika -- Get your firstname@lastname email at http://Nameplanet.com/?su -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Help forwarding from one site to another.
it's not hard coded if you use a variable instead of a literal. response.sendRedirect(aVariableThatIsSetFromSomeResourcesFileOrDatabase); --- [EMAIL PROTECTED] wrote: Thanks for that, but the issue is that it is hard coded and doesn't allow the flexibility the forward tag allows. This flexibility would be advantageous for a pluggable corporate network. Stephen. -Original Message- From: Oliver Reflé [mailto:[EMAIL PROTECTED]] Sent: 14 February 2002 13:39 To: Struts Users Mailing List Subject: AW: Help forwarding from one site to another. i would insert in the action code response.sendRedirect(www.slashdot.org); cause struts takes all addresses in the struts-config.xml as they are in the same context. This would be the easiest way to implement it. Maybe you can also achieve it with the RequestUtils of Struts, but that i don*t know Oliver -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 14. Februar 2002 14:33 An: [EMAIL PROTECTED] Betreff: Help forwarding from one site to another. Hello all, Upon a successful response from an action class I would like to forward to a different site. I have tried adding forward name=success path=http://www.slashdot.org/; / to my struts-config.xml, but it fails. Is there a nice way of achieving this? Thanks. Stephen. --- Copyright material and/or confidential and/or privileged information may be contained in this e-mail and any attached documents. The material and information is intended for the use of the intended addressee only. If you are not the intended addressee, or the person responsible for delivering it to the intended addressee, you may not copy, disclose, distribute, disseminate or deliver it to anyone else or use it in any unauthorised manner or take or omit to take any action in reliance on it. To do so is prohibited and may be unlawful. The views expressed in this e-mail may not be official policy but the personal views of the originator. If you receive this e-mail in error, please advise the sender immediately by using the reply facility in your e-mail software, or contact [EMAIL PROTECTED] Please also delete this e-mail and all documents attached immediately. Many thanks for your co-operation. BMW Financial Services (GB) Limited is registered in England and Wales under company number 01288537. Registered Offices : Europa House, Bartley Way, Hook, Hants, RG27 9UF -- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Help forwarding from one site to another.
This works : use forward name=success path=/Go.jsp / Go.jsp contains nothing but a redirect. %response.sendRedirect(http://www.slashdot.org/;);% On Thu, 14 Feb 2002 13:32:31 - [EMAIL PROTECTED] wrote: Hello all, Upon a successful response from an action class I would like to forward to a different site. I have tried adding forward name=success path=http://www.slashdot.org/; / to my struts-config.xml, but it fails. Is there a nice way of achieving this? Thanks. Stephen. --- Copyright material and/or confidential and/or privileged information may be contained in this e-mail and any attached documents. The material and information is intended for the use of the intended addressee only. If you are not the intended addressee, or the person responsible for delivering it to the intended addressee, you may not copy, disclose, distribute, disseminate or deliver it to anyone else or use it in any unauthorised manner or take or omit to take any action in reliance on it. To do so is prohibited and may be unlawful. The views expressed in this e-mail may not be official policy but the personal views of the originator. If you receive this e-mail in error, please advise the sender immediately by using the reply facility in your e-mail software, or contact [EMAIL PROTECTED] Please also delete this e-mail and all documents attached immediately. Many thanks for your co-operation. BMW Financial Services (GB) Limited is registered in England and Wales under company number 01288537. Registered Offices : Europa House, Bartley Way, Hook, Hants, RG27 9UF --- --- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Get your firstname@lastname email at http://Nameplanet.com/?su -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Indexed Tag and JavaScript Problem
Since I am using Indexed tag, my form gets the the following structure form name=currentForm method=POST action=/FALS/displaylog.do td align=leftinput type=text name=actHour[1].faHrsDay1 maxlength=4 size=6 value=0.0 onchange=update(1,1,3) form the update function is in JavaScript where I want to do some check. How to I access the form element? document.currentForm.actHour[1].faHrsDay1.value=1+1+3 does not work. error message from JavaScript is as follows. actHour1 is not an object HELP _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Help forwarding from one site to another.
Thanks for that. A simple but effective idea. I am wondering if there are any plans to add, for example, an external tag to the forward statement so that this would be unnecessary? Stephen. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 14 February 2002 13:50 To: [EMAIL PROTECTED] Subject: Re: Help forwarding from one site to another. This works : use forward name=success path=/Go.jsp / Go.jsp contains nothing but a redirect. %response.sendRedirect(http://www.slashdot.org/;);% On Thu, 14 Feb 2002 13:32:31 - [EMAIL PROTECTED] wrote: Hello all, Upon a successful response from an action class I would like to forward to a different site. I have tried adding forward name=success path=http://www.slashdot.org/; / to my struts-config.xml, but it fails. Is there a nice way of achieving this? Thanks. Stephen. --- Copyright material and/or confidential and/or privileged information may be contained in this e-mail and any attached documents. The material and information is intended for the use of the intended addressee only. If you are not the intended addressee, or the person responsible for delivering it to the intended addressee, you may not copy, disclose, distribute, disseminate or deliver it to anyone else or use it in any unauthorised manner or take or omit to take any action in reliance on it. To do so is prohibited and may be unlawful. The views expressed in this e-mail may not be official policy but the personal views of the originator. If you receive this e-mail in error, please advise the sender immediately by using the reply facility in your e-mail software, or contact [EMAIL PROTECTED] Please also delete this e-mail and all documents attached immediately. Many thanks for your co-operation. BMW Financial Services (GB) Limited is registered in England and Wales under company number 01288537. Registered Offices : Europa House, Bartley Way, Hook, Hants, RG27 9UF --- --- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Get your firstname@lastname email at http://Nameplanet.com/?su -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] --- Copyright material and/or confidential and/or privileged information may be contained in this e-mail and any attached documents. The material and information is intended for the use of the intended addressee only. If you are not the intended addressee, or the person responsible for delivering it to the intended addressee, you may not copy, disclose, distribute, disseminate or deliver it to anyone else or use it in any unauthorised manner or take or omit to take any action in reliance on it. To do so is prohibited and may be unlawful. The views expressed in this e-mail may not be official policy but the personal views of the originator. If you receive this e-mail in error, please advise the sender immediately by using the reply facility in your e-mail software, or contact [EMAIL PROTECTED] Please also delete this e-mail and all documents attached immediately. Many thanks for your co-operation. BMW Financial Services (GB) Limited is registered in England and Wales under company number 01288537. Registered Offices : Europa House, Bartley Way, Hook, Hants, RG27 9UF -- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Indexed Tag and JavaScript Problem
Your syntax is causing the browser's js interpreter is looking for actHour1 as an array object in the JavaScript code, it will return object expected errors because the form elements name is actually actHour[1].faHrsDay1 and there is likely no such array object elsewhere in your JavaScript on the page. The following should work: document.currentForm.elements[actHour[1].faHrsDay1].value Hope this helps, Adam S. Grohs - Original Message - From: SUPRIYA MISRA [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 9:50 AM Subject: Indexed Tag and JavaScript Problem Since I am using Indexed tag, my form gets the the following structure form name=currentForm method=POST action=/FALS/displaylog.do td align=leftinput type=text name=actHour[1].faHrsDay1 maxlength=4 size=6 value=0.0 onchange=update(1,1,3) form the update function is in JavaScript where I want to do some check. How to I access the form element? document.currentForm.actHour[1].faHrsDay1.value=1+1+3 does not work. error message from JavaScript is as follows. actHour1 is not an object HELP _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Indexed Tag and JavaScript Problem
Thank you so much Adams. It works. From: Adam Grohs [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Indexed Tag and JavaScript Problem Date: Mon, 16 Jul 2001 09:02:32 -0400 Your syntax is causing the browser's js interpreter is looking for actHour1 as an array object in the JavaScript code, it will return object expected errors because the form elements name is actually actHour[1].faHrsDay1 and there is likely no such array object elsewhere in your JavaScript on the page. The following should work: document.currentForm.elements[actHour[1].faHrsDay1].value Hope this helps, Adam S. Grohs - Original Message - From: SUPRIYA MISRA [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 9:50 AM Subject: Indexed Tag and JavaScript Problem Since I am using Indexed tag, my form gets the the following structure form name=currentForm method=POST action=/FALS/displaylog.do td align=leftinput type=text name=actHour[1].faHrsDay1 maxlength=4 size=6 value=0.0 onchange=update(1,1,3) form the update function is in JavaScript where I want to do some check. How to I access the form element? document.currentForm.actHour[1].faHrsDay1.value=1+1+3 does not work. error message from JavaScript is as follows. actHour1 is not an object HELP _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Help forwarding from one site to another.
[EMAIL PROTECTED] wrote: Thanks for that. A simple but effective idea. I am wondering if there are any plans to add, for example, an external tag to the forward statement so that this would be unnecessary? Did you try: forward name=success redirect=true path=http://www.slashdot.com/ Joel -- - Descriptor Systems Java, C++ and XML Training and Courseware www.descriptor.com ICQ: 150414760 - -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Help forwarding from one site to another.
MessageResources resources = getServlet().getResources(); resources.getMessage(aURLOrSomething); This is what struts supplies to get any literal from ApplicationResources.properties. That's all we need I think. --- [EMAIL PROTECTED] wrote: Thanks for that. A simple but effective idea. I am wondering if there are any plans to add, for example, an external tag to the forward statement so that this would be unnecessary? Stephen. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 14 February 2002 13:50 To: [EMAIL PROTECTED] Subject: Re: Help forwarding from one site to another. This works : use forward name=success path=/Go.jsp / Go.jsp contains nothing but a redirect. %response.sendRedirect(http://www.slashdot.org/;);% On Thu, 14 Feb 2002 13:32:31 - [EMAIL PROTECTED] wrote: Hello all, Upon a successful response from an action class I would like to forward to a different site. I have tried adding forward name=success path=http://www.slashdot.org/; / to my struts-config.xml, but it fails. Is there a nice way of achieving this? Thanks. Stephen. --- Copyright material and/or confidential and/or privileged information may be contained in this e-mail and any attached documents. The material and information is intended for the use of the intended addressee only. If you are not the intended addressee, or the person responsible for delivering it to the intended addressee, you may not copy, disclose, distribute, disseminate or deliver it to anyone else or use it in any unauthorised manner or take or omit to take any action in reliance on it. To do so is prohibited and may be unlawful. The views expressed in this e-mail may not be official policy but the personal views of the originator. If you receive this e-mail in error, please advise the sender immediately by using the reply facility in your e-mail software, or contact [EMAIL PROTECTED] Please also delete this e-mail and all documents attached immediately. Many thanks for your co-operation. BMW Financial Services (GB) Limited is registered in England and Wales under company number 01288537. Registered Offices : Europa House, Bartley Way, Hook, Hants, RG27 9UF --- --- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Get your firstname@lastname email at http://Nameplanet.com/?su -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] --- Copyright material and/or confidential and/or privileged information may be contained in this e-mail and any attached documents. The material and information is intended for the use of the intended addressee only. If you are not the intended addressee, or the person responsible for delivering it to the intended addressee, you may not copy, disclose, distribute, disseminate or deliver it to anyone else or use it in any unauthorised manner or take or omit to take any action in reliance on it. To do so is prohibited and may be unlawful. The views expressed in this e-mail may not be official policy but the personal views of the originator. If you receive this e-mail in error, please advise the sender immediately by using the reply facility in your e-mail software, or contact [EMAIL PROTECTED] Please also delete this e-mail and all documents attached immediately. Many thanks for your co-operation. BMW Financial Services (GB) Limited is registered in England and Wales under company number 01288537. Registered Offices : Europa House, Bartley Way, Hook, Hants, RG27 9UF -- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Multiple struts-config.xml files?
For the record, to create multiple ActionServlets, I just extended ActionServlet with an empty class body - basically creating an identical servlet with a different name, for each role. This is working fine with each ActionServlet reading a different struts-config file. Could there be some other problem with resources? -Original Message- From: Struts Newsgroup [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 3:55 AM To: [EMAIL PROTECTED] Subject: Re: Multiple struts-config.xml files? Subject: Re: Multiple struts-config.xml files? From: Jens Mander [EMAIL PROTECTED] === Which are the alterations required to allow struts 1.0 to permit multiple Action Servlets? Doesn't a container (e.g. Tomcat) generate separate instances for each action servlet which reads its own struts-config file and if so what kind of threading problems could occur? In my case I've been using an approach similar to what Michael describes without the RoleDispatcherServlet and I am worried about these threading problems you mention. Thanks, Ronaldo Ted Husted [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED]... Struts 1.0 isn't designed to permit multiple ActionServlets. Unless you've made some alterations, there may be threading problems. --cut -- Ted Husted, Husted dot Com, Fairport NY USA. -- Java Web Development with Struts. -- Tel +1 585 737-3463. -- Web http://www.husted.com/struts/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Help forwarding from one site to another.
This works wonderfully. Thanks everyone. Stephen. -Original Message- From: Joel Barnum [mailto:[EMAIL PROTECTED]] Sent: 14 February 2002 14:10 To: Struts Users Mailing List Subject: Re: Help forwarding from one site to another. [EMAIL PROTECTED] wrote: Thanks for that. A simple but effective idea. I am wondering if there are any plans to add, for example, an external tag to the forward statement so that this would be unnecessary? Did you try: forward name=success redirect=true path=http://www.slashdot.com/ Joel -- - Descriptor Systems Java, C++ and XML Training and Courseware www.descriptor.com ICQ: 150414760 - -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] --- Copyright material and/or confidential and/or privileged information may be contained in this e-mail and any attached documents. The material and information is intended for the use of the intended addressee only. If you are not the intended addressee, or the person responsible for delivering it to the intended addressee, you may not copy, disclose, distribute, disseminate or deliver it to anyone else or use it in any unauthorised manner or take or omit to take any action in reliance on it. To do so is prohibited and may be unlawful. The views expressed in this e-mail may not be official policy but the personal views of the originator. If you receive this e-mail in error, please advise the sender immediately by using the reply facility in your e-mail software, or contact [EMAIL PROTECTED] Please also delete this e-mail and all documents attached immediately. Many thanks for your co-operation. BMW Financial Services (GB) Limited is registered in England and Wales under company number 01288537. Registered Offices : Europa House, Bartley Way, Hook, Hants, RG27 9UF -- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Transaction Token check required before form populate
I need my transaction token checking before my form is populated. Problem here is that I have indexed properties and the valid index range may be different at different times. When all is well, the form bean and the HTML form correspond, but if the user goes back and re-submits then they may not and I can get out of range exceptions. I thought I could use the transaction token to guard against this, but of course it needs doing before the action perform() method is called. I already have a servlet derived from ActionServlet so I thought I could do it here, but of course the token checking functions are not available from here because they are protected. So it seems I have to copy the token checking code. Is there a clean way to solve this? Or maybe STRUTS needs fixing? Should the token checking functions be static and public? Duncan Harris ~~~ Hartford, Cheshire, U.K., Tel: 07968 060418 Looking for STRUTS contract work in the U.K. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RES: Writing Complex Reports and PDF
Hello Ted, JasperReport is a great open source tool. But, Java really need a professional tool to generate reports. There is some limitations to use JasperReports - doesn't exists a visual report tool to create the reports, doesn't permit subreports... There are promesses to incorporate all this funcionality to future releases of JasperReport. I'm very interesting in this topic but I can't found any tool (like Crystal Reports) that is free or not expensive to design reports... Régis Melo SoftSite Tecnologia -Mensagem original- De: Ted Husted [mailto:[EMAIL PROTECTED]] Enviada em: sexta-feira, 8 de fevereiro de 2002 18:30 Para: Struts Users Mailing List Cc: [EMAIL PROTECTED] Assunto: Writing Complex Reports and PDF On the topic of interesting developments for a Friday afternoon, here's a neat new tool that I'm playing with now http://jasperreports.sourceforge.net/ It shares a number of technologies with Struts, including the Commons-Digester. Seems promising. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Java Web Development with Struts. -- Tel +1 585 737-3463. -- Web http://www.husted.com/struts/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
session beans
How to set/get session beans in a formaction program? Could you show me an example with a code? Thanks, --- Henry Lu MCITphone: (734) 936-2063 University of Michigan Medical Center fax: (734) 763-4372 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
commons valiador
Hi I decided to try one of the recent nightly builds of struts since I wanted to become familiar with the commons validator. I am having some problems understanding what changes are needed (if any) in my source code for my formbeans etc. Is there an example app which uses the commons validator? I would like to study some working example. Thanks Neil -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Status of 1.1
Hi, we currently consider using Struts for un upcoming project and will most definetley use Struts. However, I would like to use the 1.1 version because of sveral features that appeal to us - mainly the DynaForm and the updated validation cpapbilities. From personal evaluation I learned that 1.1-dev in pretty stable and seems not to contain any showstopper bugs. I understand that nobody can provide exact release dates or something, but one of the folks from the Struts developer community might give me hint whether Struts 1.1-dev is already API stable, i.e. whether there will be major changes in package structure or even the overall architecture that require a rewrite of our application at some point in the future? Thanks in advance for any help! regards, Jürgen Albertsen argo_tec gmbh jürgen albertsen osterwaldstrasse 10 80805 muenchen germany tel. +(49) - 89 - 368179.24 fax +(49) - 89 - 368179.79 mailto:[EMAIL PROTECTED] /argo_tec gmbh -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Indexed Tag and JavaScript Problem
Now I have another problem. In JavaScirpt I have; var total=0.0; var x; for loop x=document.currentForm.elements[actHour[+loop+].faHrsDay1].value; alert(x); total=total+x; alert(total); end loop x gets the correct values like 1,2,3 but total=0.0 then 0.01, then 0.012 and so on. It is doing string concatenation instead of adding them. JavaScript Gurus please help. From: Adam Grohs [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Indexed Tag and JavaScript Problem Date: Mon, 16 Jul 2001 09:02:32 -0400 Your syntax is causing the browser's js interpreter is looking for actHour1 as an array object in the JavaScript code, it will return object expected errors because the form elements name is actually actHour[1].faHrsDay1 and there is likely no such array object elsewhere in your JavaScript on the page. The following should work: document.currentForm.elements[actHour[1].faHrsDay1].value Hope this helps, Adam S. Grohs - Original Message - From: SUPRIYA MISRA [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 9:50 AM Subject: Indexed Tag and JavaScript Problem Since I am using Indexed tag, my form gets the the following structure form name=currentForm method=POST action=/FALS/displaylog.do td align=leftinput type=text name=actHour[1].faHrsDay1 maxlength=4 size=6 value=0.0 onchange=update(1,1,3) form the update function is in JavaScript where I want to do some check. How to I access the form element? document.currentForm.actHour[1].faHrsDay1.value=1+1+3 does not work. error message from JavaScript is as follows. actHour1 is not an object HELP _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Transaction Token check required before form populate
The other thing that seems to be an annoyance is that the org.apache.struts.taglib.html.TOKEN parameter gets added for all forms on the page if it is set. I don't want this to happen. There appears to be no way to easily avoid this without overriding and replicating the whole of the FormTag.doStartTag() method. Example when I don't want this is I have a main form which is POSTed, but an auxiliary navigational form (e.g. drop-down list and Go button) which is a GET with a clean URL. However the URL is no longer very clean. Duncan Harris ~~~ Hartford, Cheshire, U.K., Tel: 07968 060418 Looking for STRUTS contract work in the U.K. [EMAIL PROTECTED] (Duncan Harris) wrote: I need my transaction token checking before my form is populated. Problem here is that I have indexed properties and the valid index range may be different at different times. When all is well, the form bean and the HTML form correspond, but if the user goes back and re-submits then they may not and I can get out of range exceptions. I thought I could use the transaction token to guard against this, but of course it needs doing before the action perform() method is called. I already have a servlet derived from ActionServlet so I thought I could do it here, but of course the token checking functions are not available from here because they are protected. So it seems I have to copy the token checking code. Is there a clean way to solve this? Or maybe STRUTS needs fixing? Should the token checking functions be static and public? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: isTokenValid(request) is always returning false
IsTokenValid() is a tricky thing. I recommend you look at the source code of this method (from Action) to better understand it. I've included the relevant source below. The tricky part is, the token needs to exist in two different places under two different keys for the call to return true. As far as I know this is completely undocumented, so without examining the source, you'd never know it. The Token must exist in the session with a key of Action.TRANSACTION_TOKEN_KEY, and in the request (as a *parameter* not an attribute) with the key of org.apache.struts.taglib.html.Constants.TOKEN_KEY. A call to saveToken() only puts the token in the session. It gets put in the request as a hidden form field by the html form tag if the Token is found in the session. Because it is not possible to add a request Parameter from inside an Action (AFAIK), the token is not immediately useful for controlling flow between actions during the same request. It is useful for controlling flow between user requests and actions. For example, you may have a page and corresponding action that allows a user to create a new account. The action may look like this: snippet if(isTokenValid(request)){ resetToken(request); createAccount(request); return mapping.findForward(success); } else{ saveToken(request); return mapping.findForward(createNewAccount); } /snippet If the token is not found in the request, the request will go through the else block, a token will be saved and the user directed to the appropriate page for inputting new account data. Assuming a Struts html:form tag is used on that page, the token will be added appropriately to the request. When the form is submitted, the request goes through the if block and creates the account. By resetting the token here, we ensure if the user clicks back and tries to resubmit the form, the account will not be re-created. This (IMHO) is the primary use of tokens, to make sure the user navigates your site as intended and does not use the back button, or a bookmark get out of sequence. Sean //Code from Action class... protected boolean isTokenValid(HttpServletRequest request) { // Retrieve the saved transaction token from our session HttpSession session = request.getSession(false); if (session == null) return (false); String saved = (String) session.getAttribute(TRANSACTION_TOKEN_KEY); if (saved == null) return (false); // Retrieve the transaction token included in this request String token = (String) request.getParameter(Constants.TOKEN_KEY); if (token == null) return (false); // Do the values match? return (saved.equals(token)); } -Original Message- From: Keith [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 6:07 AM To: Struts Users Mailing List Subject: Re: isTokenValid(request) is always returning false Wild guess here. Can you look at what's in your request parameters? Maybe - you call saveToken twice without calling isTokenValid between. So when you test isTokenValid there are 2 tokens in the request parms struts checks against the 1st one? As I say a wild guess. --- Antony Stace [EMAIL PROTECTED] wrote: saveToken() is in the action.equals(checkData) section of code, isTokenValid() is in the action.equals(saveInDatabase) section of code. The first time the user accesses this action they hit the checkData section, which has the saveToken, they do not go into the saveInDatabase section. The screen which is produced does not have any form in it(is this a problem). The user hits the save button and the same action.peform method is called, only this time action=saveInDatabase if (action.equals(saveInDatabase) isTokenValid(request) ) { } section is hopefully run. But it isn't since isTokenValid(request) is evaluating to false even though in the previous time in this function called saveToken(request). Why is the isTokenValid(request) evaluating to false even though I previously called saveToken(request) Thoughs/ideas anyone Cheers Tony On Wed, 13 Feb 2002 06:26:55 -0800 (PST) Keith [EMAIL PROTECTED] wrote: is your code in the right place? In the order you have it the token isn't in the request. at bottom of your page saveToken(request); // - I think this writes a hidden field in your jsp. // which ends up in the request after form is submitted. // send your page at top of page if ( isTokenValid(request)) { tests the token in the request. --- Antony Stace [EMAIL PROTECTED] wrote: Thanks for the reply Mark. Well...that piece of code was just a test snippet. I have a problem in an Action - TestAction (with action = checkData), in TestAction.perform() the code which handles action=checkData I have if (action.equals(checkData)) { saveToken(request);
Re: Indexed Tag and JavaScript Problem
[EMAIL PROTECTED] (SUPRIYA MISRA) wrote: Now I have another problem. In JavaScirpt I have; var total=0.0; var x; for loop x=document.currentForm.elements[actHour[+loop+].faHrsDay1].value; alert(x); total=total+x; alert(total); end loop x gets the correct values like 1,2,3 but total=0.0 then 0.01, then 0.012 and so on. It is doing string concatenation instead of adding them. That is because x is a string and if either of the arguments of + is a string it will do concatenation. You need to force x to be a number using one of: total = total + Number(x); or total = total + (x - 0); Duncan Harris ~~~ Hartford, Cheshire, U.K., Tel: 07968 060418 Looking for STRUTS contract work in the U.K. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Question taglib TEI function
Hi all, back again with a question. (btw thx for help so far) In the logic iterate tag you can say how many lines you like to display. Now I would like to have a previous/next button if there are still objects in the list available. To enable this, I added a next and previous boolean var in the iterate tag. The next will be set at the doEndTag and the previous will be set at the doStartTag. After the logic iterate tag is finished I like to look at the hasNext and hasPrevious values to see if I can add these buttons. Therefor I have to export these values, and thats what is not working. So logic:iterate hasNext=next hasPrevious=previous indexId=i in the logic.tld I have defined the hasNext and hasPrevious values. attribute namehasNext/name requiredfalse/required rtexprvaluetrue/rtexprvalue /attribute attribute namehasPrevious/name requiredfalse/required rtexprvaluetrue/rtexprvalue /attribute IterateTei.java added: String hasNext = data.getAttributeString(hasNext); VariableInfo nextInfo = null; if (hasNext != null) { nextInfo = new VariableInfo(hasNext,java.lang.String,true,VariableInfo.AT_END); count++; } String hasPrevious = data.getAttributeString(hasPrevious); VariableInfo prevInfo = null; if (hasPrevious != null) { prevInfo = new VariableInfo(hasPrevious,java.lang.String,true,VariableInfo.AT_END); count++; } VariableInfo vars[] = new VariableInfo[count]; count = 1; vars[0] = typeInfo; if (indexIdInfo != null) { vars[count] = indexIdInfo; count++; } if (nextInfo != null) { vars[count] = nextInfo; count++; } if (prevInfo != null) { vars[count] = prevInfo; count++; } return vars; However when I print the next value after the iterate tag it is always null. /logic:iterate %=next% -- this will print null Gr Ronald Furore B.V. Rijswijkstraat 175-8 Postbus 9204 1006 AE Amsterdam tel. (020) 346 71 71 fax. (020) 346 71 77 --- The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer ---
Re: session beans
FilterBean filter = (FilterBean) session.getAttribute (FilterBean.FILTERBEAN_KEY); if (filter == null) { log.info (Creating Filter); session.setAttribute (FilterBean.FILTERBEAN_KEY, new FilterBean ()); } Henry Lu wrote: How to set/get session beans in a formaction program? Could you show me an example with a code? Thanks, --- Henry Lu MCITphone: (734) 936-2063 University of Michigan Medical Center fax: (734) 763-4372 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: href:link ?
Did u search the archives? - you should be able to find examples there. http://www.mail-archive.com/struts-user@jakarta.apache.org/ Here's how I do links - people say don't use scriptlets but this can handle 1 or more parms easily is quite readable. % String linkMaintURL = linkList.do?value1=+ myBean.getX() + value2=myBen.getY();; % html:link href=%=linkMaintURL % bean:message key=Biff1.common.edit/nbsp;link /html:link Read the docs on link tag for the official way. Struts example has this functionality too. Remember it takes quite a long time much pain to learn struts. --- [EMAIL PROTECTED] wrote: Hello, I am new to Struts and I hope someone can help with this problem: I am using the iterate tag to disply some obejects (like this logic:iterate id=mybean name=MyForm property=mybeans and I can write the data like bean:write name=mybean property=x/ etc. ) For each iteration i want to create a link to a servlet. The link will contain values from the object so each link will differ from the other links, like /servletname?x1=valuex1y1=valuey1 /servletname?x2=valuex2y2=valuey2 /servletname?x3=valuex3y3=valuey3 Each link string will be created by calling a 'getRequestString(x,y)' in the corresponding form bean (MyForm). How do a make this link? I want to do something like html:link page=MyForm.getRequestString( bean:write name=mybean property=x/, bean:write name=mybean property=y/) /html:link I hope you understand what I would like to do! Thanks, Ulrika -- Get your firstname@lastname email at http://Nameplanet.com/?su -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Indexed Tag and JavaScript Problem
long time ago, but try this x=eval(document.curentForm.elements[actHour[+loop+].faHrsDay1].value); Gr Ronald -Original Message- From: SUPRIYA MISRA [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 4:00 PM To: [EMAIL PROTECTED] Subject: Re: Indexed Tag and JavaScript Problem Now I have another problem. In JavaScirpt I have; var total=0.0; var x; for loop x=document.currentForm.elements[actHour[+loop+].faHrsDay1].value; alert(x); total=total+x; alert(total); end loop x gets the correct values like 1,2,3 but total=0.0 then 0.01, then 0.012 and so on. It is doing string concatenation instead of adding them. JavaScript Gurus please help. From: Adam Grohs [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Indexed Tag and JavaScript Problem Date: Mon, 16 Jul 2001 09:02:32 -0400 Your syntax is causing the browser's js interpreter is looking for actHour1 as an array object in the JavaScript code, it will return object expected errors because the form elements name is actually actHour[1].faHrsDay1 and there is likely no such array object elsewhere in your JavaScript on the page. The following should work: document.currentForm.elements[actHour[1].faHrsDay1].value Hope this helps, Adam S. Grohs - Original Message - From: SUPRIYA MISRA [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 9:50 AM Subject: Indexed Tag and JavaScript Problem Since I am using Indexed tag, my form gets the the following structure form name=currentForm method=POST action=/FALS/displaylog.do td align=leftinput type=text name=actHour[1].faHrsDay1 maxlength=4 size=6 value=0.0 onchange=update(1,1,3) form the update function is in JavaScript where I want to do some check. How to I access the form element? document.currentForm.actHour[1].faHrsDay1.value=1+1+3 does not work. error message from JavaScript is as follows. actHour1 is not an object HELP _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] Furore B.V. Rijswijkstraat 175-8 Postbus 9204 1006 AE Amsterdam tel. (020) 346 71 71 fax. (020) 346 71 77 --- The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer ---
RE: Indexed Tag and JavaScript Problem
oops skip that didnt look well enough at your code try this: var x = parseInt(...,10) Gr Ronald -Original Message- From: Ronald Haring [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 4:20 PM To: 'Struts Users Mailing List' Subject: RE: Indexed Tag and JavaScript Problem long time ago, but try this x=eval(document.curentForm.elements[actHour[+loop+].faHrsDa y1].value); Gr Ronald -Original Message- From: SUPRIYA MISRA [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 4:00 PM To: [EMAIL PROTECTED] Subject: Re: Indexed Tag and JavaScript Problem Now I have another problem. In JavaScirpt I have; var total=0.0; var x; for loop x=document.currentForm.elements[actHour[+loop+].faHrsDay1].value; alert(x); total=total+x; alert(total); end loop x gets the correct values like 1,2,3 but total=0.0 then 0.01, then 0.012 and so on. It is doing string concatenation instead of adding them. JavaScript Gurus please help. From: Adam Grohs [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Indexed Tag and JavaScript Problem Date: Mon, 16 Jul 2001 09:02:32 -0400 Your syntax is causing the browser's js interpreter is looking for actHour1 as an array object in the JavaScript code, it will return object expected errors because the form elements name is actually actHour[1].faHrsDay1 and there is likely no such array object elsewhere in your JavaScript on the page. The following should work: document.currentForm.elements[actHour[1].faHrsDay1].value Hope this helps, Adam S. Grohs - Original Message - From: SUPRIYA MISRA [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 9:50 AM Subject: Indexed Tag and JavaScript Problem Since I am using Indexed tag, my form gets the the following structure form name=currentForm method=POST action=/FALS/displaylog.do td align=leftinput type=text name=actHour[1].faHrsDay1 maxlength=4 size=6 value=0.0 onchange=update(1,1,3) form the update function is in JavaScript where I want to do some check. How to I access the form element? document.currentForm.actHour[1].faHrsDay1.value=1+1+3 does not work. error message from JavaScript is as follows. actHour1 is not an object HELP _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] Furore B.V. Rijswijkstraat 175-8 Postbus 9204 1006 AE Amsterdam tel. (020) 346 71 71 fax. (020) 346 71 77 -- -- --- The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer -- -- --- Furore B.V. Rijswijkstraat 175-8 Postbus 9204 1006 AE Amsterdam tel. (020) 346 71 71 fax. (020) 346 71 77 --- The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer ---
Re: Transaction Token check required before form populate
The usual workflow is to visit an Action before displaying the page. This gives you the opportunity to any number of things, including setting up the tokens. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Java Web Development with Struts. -- Tel +1 585 737-3463. -- Web http://www.husted.com/struts/ Duncan Harris wrote: I need my transaction token checking before my form is populated. Problem here is that I have indexed properties and the valid index range may be different at different times. When all is well, the form bean and the HTML form correspond, but if the user goes back and re-submits then they may not and I can get out of range exceptions. I thought I could use the transaction token to guard against this, but of course it needs doing before the action perform() method is called. I already have a servlet derived from ActionServlet so I thought I could do it here, but of course the token checking functions are not available from here because they are protected. So it seems I have to copy the token checking code. Is there a clean way to solve this? Or maybe STRUTS needs fixing? Should the token checking functions be static and public? Duncan Harris ~~~ Hartford, Cheshire, U.K., Tel: 07968 060418 Looking for STRUTS contract work in the U.K. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
digest
digest The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Transaction Token check required before form populate
One solution would be to write the GET form youself, using bean:write to populate the the HTML controls. If someone submitted a patch to bugzilla that allowed the generation of the token to be switched off on a form by form basis, I'm sure it would be considered. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Java Web Development with Struts. -- Tel +1 585 737-3463. -- Web http://www.husted.com/struts/ Duncan Harris wrote: The other thing that seems to be an annoyance is that the org.apache.struts.taglib.html.TOKEN parameter gets added for all forms on the page if it is set. I don't want this to happen. There appears to be no way to easily avoid this without overriding and replicating the whole of the FormTag.doStartTag() method. Example when I don't want this is I have a main form which is POSTed, but an auxiliary navigational form (e.g. drop-down list and Go button) which is a GET with a clean URL. However the URL is no longer very clean. Duncan Harris ~~~ Hartford, Cheshire, U.K., Tel: 07968 060418 Looking for STRUTS contract work in the U.K. [EMAIL PROTECTED] (Duncan Harris) wrote: I need my transaction token checking before my form is populated. Problem here is that I have indexed properties and the valid index range may be different at different times. When all is well, the form bean and the HTML form correspond, but if the user goes back and re-submits then they may not and I can get out of range exceptions. I thought I could use the transaction token to guard against this, but of course it needs doing before the action perform() method is called. I already have a servlet derived from ActionServlet so I thought I could do it here, but of course the token checking functions are not available from here because they are protected. So it seems I have to copy the token checking code. Is there a clean way to solve this? Or maybe STRUTS needs fixing? Should the token checking functions be static and public? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: isTokenValid(request) is always returning false
This (IMHO) is the primary use of tokens, to make sure the user navigates your site as intended and does not use the back button, or a bookmark get out of sequence. (IMHO) your humble opinion is absolutely right except it's the only use of tokens. Note that data entry forms don't always need them. If they are written so they have no 'state' info in the session (all the data is on the form) you can let the user use the back button. --- Pritchard, Sean [EMAIL PROTECTED] wrote: IsTokenValid() is a tricky thing. I recommend you look at the source code of this method (from Action) to better understand it. I've included the relevant source below. The tricky part is, the token needs to exist in two different places under two different keys for the call to return true. As far as I know this is completely undocumented, so without examining the source, you'd never know it. The Token must exist in the session with a key of Action.TRANSACTION_TOKEN_KEY, and in the request (as a *parameter* not an attribute) with the key of org.apache.struts.taglib.html.Constants.TOKEN_KEY. A call to saveToken() only puts the token in the session. It gets put in the request as a hidden form field by the html form tag if the Token is found in the session. Because it is not possible to add a request Parameter from inside an Action (AFAIK), the token is not immediately useful for controlling flow between actions during the same request. It is useful for controlling flow between user requests and actions. For example, you may have a page and corresponding action that allows a user to create a new account. The action may look like this: snippet if(isTokenValid(request)){ resetToken(request); createAccount(request); return mapping.findForward(success); } else{ saveToken(request); return mapping.findForward(createNewAccount); } /snippet If the token is not found in the request, the request will go through the else block, a token will be saved and the user directed to the appropriate page for inputting new account data. Assuming a Struts html:form tag is used on that page, the token will be added appropriately to the request. When the form is submitted, the request goes through the if block and creates the account. By resetting the token here, we ensure if the user clicks back and tries to resubmit the form, the account will not be re-created. This (IMHO) is the primary use of tokens, to make sure the user navigates your site as intended and does not use the back button, or a bookmark get out of sequence. Sean //Code from Action class... protected boolean isTokenValid(HttpServletRequest request) { // Retrieve the saved transaction token from our session HttpSession session = request.getSession(false); if (session == null) return (false); String saved = (String) session.getAttribute(TRANSACTION_TOKEN_KEY); if (saved == null) return (false); // Retrieve the transaction token included in this request String token = (String) request.getParameter(Constants.TOKEN_KEY); if (token == null) return (false); // Do the values match? return (saved.equals(token)); } -Original Message- From: Keith [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 6:07 AM To: Struts Users Mailing List Subject: Re: isTokenValid(request) is always returning false Wild guess here. Can you look at what's in your request parameters? Maybe - you call saveToken twice without calling isTokenValid between. So when you test isTokenValid there are 2 tokens in the request parms struts checks against the 1st one? As I say a wild guess. --- Antony Stace [EMAIL PROTECTED] wrote: saveToken() is in the action.equals(checkData) section of code, isTokenValid() is in the action.equals(saveInDatabase) section of code. The first time the user accesses this action they hit the checkData section, which has the saveToken, they do not go into the saveInDatabase section. The screen which is produced does not have any form in it(is this a problem). The user hits the save button and the same action.peform method is called, only this time action=saveInDatabase if (action.equals(saveInDatabase) isTokenValid(request) ) { } section is hopefully run. But it isn't since isTokenValid(request) is evaluating to false even though in the previous time in this function called saveToken(request). Why is the isTokenValid(request) evaluating to false even though I previously called saveToken(request) Thoughs/ideas anyone Cheers Tony On Wed, 13 Feb 2002 06:26:55 -0800 (PST) Keith [EMAIL PROTECTED] wrote: is your code in the right place? In the order you have it the token isn't in the request. at bottom of your page
Re: Indexed Tag and JavaScript Problem
Thanks.I used parseFloat() to do that and it works. From: [EMAIL PROTECTED] (Duncan Harris) Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Indexed Tag and JavaScript Problem Date: Thu, 14 Feb 2002 15:12 + (GMT Standard Time) [EMAIL PROTECTED] (SUPRIYA MISRA) wrote: Now I have another problem. In JavaScirpt I have; var total=0.0; var x; for loop x=document.currentForm.elements[actHour[+loop+].faHrsDay1].value; alert(x); total=total+x; alert(total); end loop x gets the correct values like 1,2,3 but total=0.0 then 0.01, then 0.012 and so on. It is doing string concatenation instead of adding them. That is because x is a string and if either of the arguments of + is a string it will do concatenation. You need to force x to be a number using one of: total = total + Number(x); or total = total + (x - 0); Duncan Harris ~~~ Hartford, Cheshire, U.K., Tel: 07968 060418 Looking for STRUTS contract work in the U.K. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: digest
How did you know I'd just eaten lunch? --- [EMAIL PROTECTED] wrote: digest __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: digest
Thanks for bringing this up. I just realized the Digest subscription information is not on the mailing list page. The address you are looking for is [EMAIL PROTECTED] -- Ted Husted, Husted dot Com, Fairport NY USA. -- Java Web Development with Struts. -- Tel +1 585 737-3463. -- Web http://www.husted.com/struts/ [EMAIL PROTECTED] wrote: digest The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Transaction Token check required before form populate
If you simply need to prevent resubmits, set a token as a session variable, check its value on any submit, and change its value on the first submit. Cheers! Mark -- Try before you cry: http://www.mail-archive.com/struts-user%40jakarta.apache.org/ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 9:20 AM Problem here is that I have indexed properties and the valid index range may be different at different times. When all is well, the form bean and the HTML form correspond, but if the user goes back and re-submits then they may not and I can get out of range exceptions. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Internationalization issues
Hi all :) I have to questions concerning initialization. In the user's guide I saw an example with a bean:message and an html:message tag being used for retrieving strings from a properties file from the struts-bean taglib and the struts:html taglib. What's the difference? I saw that in web.xml you can configure a properties file that holds the strings which can later be retrieved for custom tags. As I see it there is only one init parameter (name is application) that can be used to refer to such a properties file. What if I want to use different properties files, say one per package. How can I configure those so Struts knows where to find them? Thanks for your input. I'd appreciate any ideas. Bernie -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Indexed Tag and JavaScript Problem
total =+ total + parseInt( x); Cheers! Mark -- Try before you cry: http://www.mail-archive.com/struts-user%40jakarta.apache.org/ -Original Message- From: SUPRIYA MISRA [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 10:00 AM To: [EMAIL PROTECTED] Subject: Re: Indexed Tag and JavaScript Problem Now I have another problem. In JavaScirpt I have; var total=0.0; var x; for loop x=document.currentForm.elements[actHour[+loop+].faHrsDay1].value; alert(x); total=total+x; alert(total); end loop x gets the correct values like 1,2,3 but total=0.0 then 0.01, then 0.012 and so on. It is doing string concatenation instead of adding them. JavaScript Gurus please help. From: Adam Grohs [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Indexed Tag and JavaScript Problem Date: Mon, 16 Jul 2001 09:02:32 -0400 Your syntax is causing the browser's js interpreter is looking for actHour1 as an array object in the JavaScript code, it will return object expected errors because the form elements name is actually actHour[1].faHrsDay1 and there is likely no such array object elsewhere in your JavaScript on the page. The following should work: document.currentForm.elements[actHour[1].faHrsDay1].value Hope this helps, Adam S. Grohs - Original Message - From: SUPRIYA MISRA [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 9:50 AM Subject: Indexed Tag and JavaScript Problem Since I am using Indexed tag, my form gets the the following structure form name=currentForm method=POST action=/FALS/displaylog.do td align=leftinput type=text name=actHour[1].faHrsDay1 maxlength=4 size=6 value=0.0 onchange=update(1,1,3) form the update function is in JavaScript where I want to do some check. How to I access the form element? document.currentForm.actHour[1].faHrsDay1.value=1+1+3 does not work. error message from JavaScript is as follows. actHour1 is not an object HELP _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Showing a result after a long running query
Jim, These comments are really guesses about how to do this rather than knowledge... None of it relies on Struts in particular. You have three pages: Form, Working and Results. On the form page, you submit the data to the Working page which will store the query request somewhere (possibly in the session scope but preferably in the DB) and return a page with an animated 'working' gif. This page then uses a meta http-equiv=refresh to call the Results page. The animated gif of the Working page just keeps on animating until your long query / process returns some output to the browser. In IE 5.5 + Netscape 6 on NT, when pressing the back button it ignores the Working page so you should be fine. HTH, Chris. -Original Message- From: Jim Tyrrell [mailto:[EMAIL PROTECTED]] Sent: 13 February 2002 19:25 To: '[EMAIL PROTECTED]' Subject: Showing a result after a long running query Hello all, I have looked at the struts docs and all over the net and I have posted to forums at java.sun.com. I want to show a user a page that says I am working on your problem and then when the processing is done I will send to them/display for them the output of the long running database query/process whatever. Note I do not want the working in progress page to be shown again if I hit the back button of the browser. I should just get to the form that I inputted my parameters into to get the process rolling. Does struts support this? Does anyone know how to do this with some other technology? This seems like a common problem and there should be an easy solution or at least you would think so. Thank You Jim Tyrrell -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Indexed Tag and JavaScript Problem
Oops. That should be total =+ parseFloat( x); Mark -Original Message- From: Galbreath, Mark Sent: Thursday, February 14, 2002 10:49 AM To: 'Struts Users Mailing List' Subject: RE: Indexed Tag and JavaScript Problem total =+ total + parseInt( x); Cheers! Mark -- Try before you cry: http://www.mail-archive.com/struts-user%40jakarta.apache.org/ -Original Message- From: SUPRIYA MISRA [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 10:00 AM To: [EMAIL PROTECTED] Subject: Re: Indexed Tag and JavaScript Problem Now I have another problem. In JavaScirpt I have; var total=0.0; var x; for loop x=document.currentForm.elements[actHour[+loop+].faHrsDay1].value; alert(x); total=total+x; alert(total); end loop x gets the correct values like 1,2,3 but total=0.0 then 0.01, then 0.012 and so on. It is doing string concatenation instead of adding them. JavaScript Gurus please help. From: Adam Grohs [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Indexed Tag and JavaScript Problem Date: Mon, 16 Jul 2001 09:02:32 -0400 Your syntax is causing the browser's js interpreter is looking for actHour1 as an array object in the JavaScript code, it will return object expected errors because the form elements name is actually actHour[1].faHrsDay1 and there is likely no such array object elsewhere in your JavaScript on the page. The following should work: document.currentForm.elements[actHour[1].faHrsDay1].value Hope this helps, Adam S. Grohs - Original Message - From: SUPRIYA MISRA [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 9:50 AM Subject: Indexed Tag and JavaScript Problem Since I am using Indexed tag, my form gets the the following structure form name=currentForm method=POST action=/FALS/displaylog.do td align=leftinput type=text name=actHour[1].faHrsDay1 maxlength=4 size=6 value=0.0 onchange=update(1,1,3) form the update function is in JavaScript where I want to do some check. How to I access the form element? document.currentForm.actHour[1].faHrsDay1.value=1+1+3 does not work. error message from JavaScript is as follows. actHour1 is not an object HELP _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: SQL in Logic Bean or Action class
Hey sean, The following is some dialog I had with a couple of guys on the message board about sql placement. I thought you might find it interesting. Ultimately, just read Ted Husted. Also, I have some thoughts I would like to pass by you when you have a few moments. I have to make some changes to my content management. I have run into a minor snag. Brandon Goodin Phase Web and Multimedia P (406) 862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 8:55 PM To: Struts Users Mailing List Subject: Re: SQL in Logic Bean or Action class It sounds fine to me. The important thing is to follow the layers pattern [ view ] | [ controller ] | [ model ] The view can talk to the controller, and the controller can talk to the model, but when you le the view and model talk, it starts to spin out of control. I like to call a business method and get back a collection of beans, so that the Action does not even have to bother with that.But since the contoller and the model are on adjacent layers, the Action could also walk through a result set, if that works for you. The only thing is to get the connection back into the pool as soon as possible. For transfering data between beans, the BeanUtils can also be helpful. Phase Communcations wrote: A quick hypothetical scenario: I have an action class that needs to pass a list of addresses to the view for display. I have a logic bean that contains a sql call to a database and retrieves address info. The resulset returns the following fields in each record: NAME, ADDRESS, CITY, STATE, ZIP I have a databean that has the following methods: setName(), setAddress(), setCity(), setState(), setZip() An ArrayList(Collection) is created. For each record in the resultset the fields are used to populate the databean (ie NAME - setName()) by calling it's property setting methods. Each bean populated is added to the ArrayList. Upon the end of the resultset the ArrayList is passed into a scope (request for example) by the Action class and named addresslist. The list of addresses then become available to the view for iteration and display. Where am I crossing boundaries in this scenario? Brandon Goodin Phase Web and Multimedia P (406) 862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 12:02 PM To: 'Struts Users Mailing List' Subject: RE: SQL in Logic Bean or Action class You are on the right track. Keep the sql with the model. The only thing is don't let your collection of databeans make it to the jsp. That would then tie your presentation to the model. Very bad. There should be another set of beans that represents more of what the view is like. Often times in the view beans all the data types will be string to make the validation a lot easier. Jeff Krueger -Original Message- From: Phase Communcations [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 11:40 AM To: Struts Users Mailing List Subject: SQL in Logic Bean or Action class Just a simple design question. Having read through several posts and reading the Struts documentation. I was wondering what is the best design pattern regarding SQL placement. My thoughts were that I need to keep SQL out of the action class and pass all resultset data into Collections of beans. This helps keep from having tons of connections and resulsets sitting out there tieing up valuable database resources. The collection of databeans are then placed in a scope using the Controller(Action class)and made available to other logic processes in the scope and/or passed on to the view for data display. I am assuming this is because business logic beans should be designed and implemented so that they do not know they are being executed in a web application environment. Is my interpretation that SQL is part of the Model and should be placed in Logic beans tweaked? Or is this a 6 and half dozen scenario? Or is there another pattern that I am missing altogether? Brandon Goodin Phase Web and Multimedia P (406) 862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Ted Husted, Husted dot Com, Fairport NY USA. -- Java Web Development with Struts. -- Tel +1 585 737-3463. -- Web http://www.husted.com/struts/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For
BIG DUMMY: SQL in Logic Bean or Action class
SORRY I FORGOT TO TO CHANGE THE RECIPIENT. -Original Message- From: Phase Communcations [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 9:03 AM To: Struts Users Mailing List Subject: RE: SQL in Logic Bean or Action class Hey sean, The following is some dialog I had with a couple of guys on the message board about sql placement. I thought you might find it interesting. Ultimately, just read Ted Husted. Also, I have some thoughts I would like to pass by you when you have a few moments. I have to make some changes to my content management. I have run into a minor snag. Brandon Goodin Phase Web and Multimedia P (406) 862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 8:55 PM To: Struts Users Mailing List Subject: Re: SQL in Logic Bean or Action class It sounds fine to me. The important thing is to follow the layers pattern [ view ] | [ controller ] | [ model ] The view can talk to the controller, and the controller can talk to the model, but when you le the view and model talk, it starts to spin out of control. I like to call a business method and get back a collection of beans, so that the Action does not even have to bother with that.But since the contoller and the model are on adjacent layers, the Action could also walk through a result set, if that works for you. The only thing is to get the connection back into the pool as soon as possible. For transfering data between beans, the BeanUtils can also be helpful. Phase Communcations wrote: A quick hypothetical scenario: I have an action class that needs to pass a list of addresses to the view for display. I have a logic bean that contains a sql call to a database and retrieves address info. The resulset returns the following fields in each record: NAME, ADDRESS, CITY, STATE, ZIP I have a databean that has the following methods: setName(), setAddress(), setCity(), setState(), setZip() An ArrayList(Collection) is created. For each record in the resultset the fields are used to populate the databean (ie NAME - setName()) by calling it's property setting methods. Each bean populated is added to the ArrayList. Upon the end of the resultset the ArrayList is passed into a scope (request for example) by the Action class and named addresslist. The list of addresses then become available to the view for iteration and display. Where am I crossing boundaries in this scenario? Brandon Goodin Phase Web and Multimedia P (406) 862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 12:02 PM To: 'Struts Users Mailing List' Subject: RE: SQL in Logic Bean or Action class You are on the right track. Keep the sql with the model. The only thing is don't let your collection of databeans make it to the jsp. That would then tie your presentation to the model. Very bad. There should be another set of beans that represents more of what the view is like. Often times in the view beans all the data types will be string to make the validation a lot easier. Jeff Krueger -Original Message- From: Phase Communcations [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 11:40 AM To: Struts Users Mailing List Subject: SQL in Logic Bean or Action class Just a simple design question. Having read through several posts and reading the Struts documentation. I was wondering what is the best design pattern regarding SQL placement. My thoughts were that I need to keep SQL out of the action class and pass all resultset data into Collections of beans. This helps keep from having tons of connections and resulsets sitting out there tieing up valuable database resources. The collection of databeans are then placed in a scope using the Controller(Action class)and made available to other logic processes in the scope and/or passed on to the view for data display. I am assuming this is because business logic beans should be designed and implemented so that they do not know they are being executed in a web application environment. Is my interpretation that SQL is part of the Model and should be placed in Logic beans tweaked? Or is this a 6 and half dozen scenario? Or is there another pattern that I am missing altogether? Brandon Goodin Phase Web and Multimedia P (406) 862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Ted Husted, Husted dot Com, Fairport NY USA. -- Java Web Development with
RE: Showing a result after a long running query
Chris's idea seems good. But I think users might find such a screen rather irritating. Some thoughts:- 1 - I've heard of something called 'push' technology. Servers push data out to the client when it suits them. Search web for that. 2 - Alternative. Store on your DB that a request for this user has started but not finished. Start request display the request status enquiry... Request Status enquiry. Using good old struts (so we aren't off topic here) write a page that lists the users uncompleted requests. At the top is a big message Press F5 To Update The Status list This has the advantage that your request the status of the request are using the same data store so are in the same transaction. So when things foul up your list of requests always tells the truth. K/ --- Chris Birch [EMAIL PROTECTED] wrote: Jim, These comments are really guesses about how to do this rather than knowledge... None of it relies on Struts in particular. You have three pages: Form, Working and Results. On the form page, you submit the data to the Working page which will store the query request somewhere (possibly in the session scope but preferably in the DB) and return a page with an animated 'working' gif. This page then uses a meta http-equiv=refresh to call the Results page. The animated gif of the Working page just keeps on animating until your long query / process returns some output to the browser. In IE 5.5 + Netscape 6 on NT, when pressing the back button it ignores the Working page so you should be fine. HTH, Chris. -Original Message- From: Jim Tyrrell [mailto:[EMAIL PROTECTED]] Sent: 13 February 2002 19:25 To: '[EMAIL PROTECTED]' Subject: Showing a result after a long running query Hello all, I have looked at the struts docs and all over the net and I have posted to forums at java.sun.com. I want to show a user a page that says I am working on your problem and then when the processing is done I will send to them/display for them the output of the long running database query/process whatever. Note I do not want the working in progress page to be shown again if I hit the back button of the browser. I should just get to the form that I inputted my parameters into to get the process rolling. Does struts support this? Does anyone know how to do this with some other technology? This seems like a common problem and there should be an easy solution or at least you would think so. Thank You Jim Tyrrell -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Indexed Tag and JavaScript Problem
Hi, try this total += parseFloat(x); Les -Original Message- From: SUPRIYA MISRA [mailto:[EMAIL PROTECTED]] Sent: 14 February 2002 15:00 To: [EMAIL PROTECTED] Subject: Re: Indexed Tag and JavaScript Problem Now I have another problem. In JavaScirpt I have; var total=0.0; var x; for loop x=document.currentForm.elements[actHour[+loop+].faHrsDay1].value; alert(x); total=total+x; alert(total); end loop x gets the correct values like 1,2,3 but total=0.0 then 0.01, then 0.012 and so on. It is doing string concatenation instead of adding them. JavaScript Gurus please help. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Showing a result after a long running query
A solution that was written before we used Struts, but it works for us. We have a process that generates some figures for bank loans. It takes interest rate and loan amount, and works out repayments etc, taking into account lots of other variables. This process can take minutes to complete. In order to speed up our web site, rather than do this online for each person applying for a loan, we pre-generate a deals.xml file containing the figures for various loan amounts and numbers of repayments. This process has been known to take up to six hours to complete. What we've done is to have a bean implement Observable, and then have an Observer bean that is notifed each time one of the calculations completes. We have a web page that keeps refreshing itself, and that gets information from the Observer and prints out progress to date each time. We also have a cancel link, that tells the Observable object to stop calculating. Hope that's of interest... Tim. -Original Message- From: Chris Birch [mailto:[EMAIL PROTECTED]] Sent: 14 February 2002 15:56 To: Struts Users Mailing List Subject: RE: Showing a result after a long running query Jim, These comments are really guesses about how to do this rather than knowledge... None of it relies on Struts in particular. You have three pages: Form, Working and Results. On the form page, you submit the data to the Working page which will store the query request somewhere (possibly in the session scope but preferably in the DB) and return a page with an animated 'working' gif. This page then uses a meta http-equiv=refresh to call the Results page. The animated gif of the Working page just keeps on animating until your long query / process returns some output to the browser. In IE 5.5 + Netscape 6 on NT, when pressing the back button it ignores the Working page so you should be fine. HTH, Chris. -Original Message- From: Jim Tyrrell [mailto:[EMAIL PROTECTED]] Sent: 13 February 2002 19:25 To: '[EMAIL PROTECTED]' Subject: Showing a result after a long running query Hello all, I have looked at the struts docs and all over the net and I have posted to forums at java.sun.com. I want to show a user a page that says I am working on your problem and then when the processing is done I will send to them/display for them the output of the long running database query/process whatever. Note I do not want the working in progress page to be shown again if I hit the back button of the browser. I should just get to the form that I inputted my parameters into to get the process rolling. Does struts support this? Does anyone know how to do this with some other technology? This seems like a common problem and there should be an easy solution or at least you would think so. Thank You Jim Tyrrell -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] This e-mail and its attachments are for the use of the addressee only. It may contain information that is legally privileged, confidential and exempt from disclosure. It is not a contract, and prices, data and other information are not warranted as to completeness or accuracy. Any comments or statements made herein do not necessarily reflect those of PanCredit Systems Limited. If you are not the intended recipient you must not copy, distribute or disseminate this e-mail or attachments to anyone other than the addressee. If you receive this communication in error please advise us by telephone at once. PanCredit Systems Limited Tel:+44 113 250 0260 Fax:+44 113 250 0621 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: commons valiador
There is an example in the nightly source in contrib/validator (contrib/validator/src/example and contrib/validator/web/example). It is also posted at http://home.earthlink.net/~dwinterfeldt/ and there is a compiled jar of the Commons Validator in the build directory (no nightly build of it yet). David --- [EMAIL PROTECTED] wrote: Hi I decided to try one of the recent nightly builds of struts since I wanted to become familiar with the commons validator. I am having some problems understanding what changes are needed (if any) in my source code for my formbeans etc. Is there an example app which uses the commons validator? I would like to study some working example. Thanks Neil -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: error running tile: Cannot find message resources
The example run on my development version. What about the others links in examples ? Maybe a problem with your configuration ? Cedric c tang wrote: I am running the app as as is. I used the trick you suggested and it solved the resource problem. Another problem occured when accessing examples/rssChannels.jsp here is the exception, javax.servlet.jsp.JspException: Error - Tag Insert : Can't get definition 'examples.rssChannels.page'. Check if this name exist in definitions factory. at org.apache.struts.taglib.tiles.InsertTag.processDefinitionName(InsertTag.java:496) at org.apache.struts.taglib.tiles.InsertTag.createTagHandler(InsertTag.java:385) at org.apache.struts.taglib.tiles.InsertTag.doStartTag(InsertTag.java:342) at org.apache.jsp.rssChannels$jsp._jspService(rssChannels$jsp.java:69) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107) at java.lang.Thread.run(Thread.java:484) --- Cedric Dumoulin [EMAIL PROTECTED] wrote: There is two possibilities : * You have specified a message resource file in web.xml, but this file doesn't exist. (not the case if you use Tiles tutorial 'as is'). * You use a recent Struts version which require a resource file even if you don't specify it ;-( I have encountered this problem with latest nightly builds, and haven't dig in Struts yet to localize the problem (sound like a bug for me). I use a trick proposed by Hertzel Karbasi : define an empty resource file and specify it in your web.xml file. Cedric __ Do You Yahoo!? Send FREE Valentine eCards with
Re: Passing Action Errors from one perform() method to another perfor m() method - Expert help?
John == John Mattos Mattos writes: John Hi all. John I'm trying to do the following. John In an Action.perform() method, I'm adding an ActionErrors object to the John request as follows John // Snippet from an Action.perform() method John ActionErrors errors = new ActionErrors (); John errors.add(Processed, new ActionError(Processing Done)); John saveErrors(request, errors); John return new ActionForward(/suspends.do); John // End of first perform() snippet John Notice that I'm forwarding to a .do, which means I'm in another perform() John method John in the SECOND perform() method, I want to do some preprocessing (get stuff John from a database) John then forward to a JSP, and INLCUDE the actionErrors object from the first John perform() method. John Here's how I'm doing that now John // snipped from second perform() method, mapped to suspends.do John ActionErrors errors = new ActionErrors(); John errors= (ActionErrors)request.getAttribute(Processed); John saveErrors (request, errors); John return new ActionForward(/invoicing/suspendsSummary.jsp); John // End of second perform() snippet John am I going about this in the wrong way? Is this even possible? John basically, I want to pass a message back to the jsp that is really a status John message (as in.. I'm done processing) You may be showing an inappropriate example, but I would say that you're trying to store information that is not an error. I would just create a collection as a session attribute and store this information. You can display the records in that collection in each JSP in the workflow. -- === David M. Karr ; Java/J2EE/XML/Unix/C++ [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Nightly Builds
Can any one tell me which nightly build is stable enough to actually develop with? Often I encounter problems with missing tag handlers or conflicting method definitions between the TLD and tag classes making the build pretty much unusable... Thanks -Original Message- From: Sid Stuart [SMTP:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 9:18 AM To: Struts Users Mailing List Subject: Re: session beans FilterBean filter = (FilterBean) session.getAttribute (FilterBean.FILTERBEAN_KEY); if (filter == null) { log.info (Creating Filter); session.setAttribute (FilterBean.FILTERBEAN_KEY, new FilterBean ()); } Henry Lu wrote: How to set/get session beans in a formaction program? Could you show me an example with a code? Thanks, -- - Henry Lu MCITphone: (734) 936-2063 University of Michigan Medical Center fax: (734) 763-4372 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Struts-config initialization
When the struts-config file is initialized, does it place the ActionMappings into a bean or are the ActionMappings checked against the struts-config file each time a */do/* url is accessed? My reason for asking is that I plan to create a config file that will define the content available to a page based on it's Action Mapping. I plan to write an extendable generic ActionClass that can read the config file and determine what data it needs to provide to the page based on the Action Mapping. The page tags will then determine the placement of the data on the page. I am just wondering if I should place all of the mappings into an app bean to be accessed by the GenericAction or leave them in the config file and parse the config for mappings. The answer seems to be the bean. But, I would like to do it in the same manner that Struts does. Brandon Goodin Phase Web and Multimedia P (406) 862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Bean tag and substrings
Is there any way to use the bean tag to display a substring of a property? Thanks, dave -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]