greetings a newbie question
hi, just joined the list, and i have a newbie question about struts design. this is where i am at. i have looked at struts about a year back, and rolled my own version of mvc web architecture, stealing several basic ideas from struts. at the time, it appeared that many features of struts were not apparently applicable to the project, so the overhead of configuring struts didn't seem justifiable. now the need for many of the struts features has become pretty concrete, and so i am in process of incorporating struts rather than re-inventing the wheels (and axels and cupholders, etc). while adapting the code base to use struts, i get the sense that: these are the classes/packages; for many, you can configure/adapt it to your needs via config files; in other aspects, you may want/need to subclass and override some of the classes to fit your needs. for the later category of adaptation (subclassing/overriding), the best way seems to be to look into the source to ascertain the default behavior and to ensure the overriding implementation is proper. to put it simply, struts' interface doesn't seem to be clearly defined. by clearly defined interface, i mean programming/usage could/should be via/against the interface without delving into implementation details. if not, pointer(s) to the authoritative interface defnitions would be much appreciated (i told you i'm a newbie). but if so, is this deliberate? and the reasoning behind? some obvious (generic) arguments i could see are: 1. it's advantageous in order to provide greater flexibility, struts being a development framework 2. struts (and web app requirements) are progressing rapidly, so loose interface may serve the purpose better are there more specific reasons other than these? or perhaps it is simply a documentation issue? thanx for any insight/info, dasa ps: i am sending this to both the user and dev lists, thinking the subject is of interest to both. perhaps you'll correct me. again, a newbie here. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
collection of strings (newbie question)
I have an action that creates a bean. That bean has a property myStrings that returns a collection of String objects. On a jsp, I want to list the strings. If my jsp has this: logic:iterate id=myId name=myBean property=myStrings bean:write name=myId/ /logic:iterate Then I get an exception Cannot find bean myId in any scope. I can understand that cos myId is a String not a bean. What should I use instead of bean:write ? Steve ___ Yahoo! Messenger - Communicate instantly...Ping your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: collection of strings (newbie question)
Have you import logic taglibs ? steve hazelwood wrote: I have an action that creates a bean. That bean has a property myStrings that returns a collection of String objects. On a jsp, I want to list the strings. If my jsp has this: logic:iterate id=myId name=myBean property=myStrings bean:write name=myId/ /logic:iterate Then I get an exception Cannot find bean myId in any scope. I can understand that cos myId is a String not a bean. What should I use instead of bean:write ? Steve ___ Yahoo! Messenger - Communicate instantly...Ping your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: collection of strings (newbie question)
Solved, well done. I'm glad I put 'newbie' in the subject line now :-) Thanks, Steve On 9 Mar 2004 at 11:03, Daniel Henrique Alves Lima wrote: Have you import logic taglibs ? steve hazelwood wrote: I have an action that creates a bean. That bean has a property myStrings that returns a collection of String objects. On a jsp, I want to list the strings. If my jsp has this: logic:iterate id=myId name=myBean property=myStrings bean:write name=myId/ /logic:iterate Then I get an exception Cannot find bean myId in any scope. I can understand that cos myId is a String not a bean. What should I use instead of bean:write ? Steve ___ Yahoo! Messenger - Communicate instantly...Ping your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: collection of strings (newbie question)
Hi all, Other possibility is to check whether 'myBean' exists in some scope. Cheers, Daniel Silva. --- Daniel Henrique Alves Lima [EMAIL PROTECTED] wrote: Have you import logic taglibs ? steve hazelwood wrote: I have an action that creates a bean. That bean has a property myStrings that returns a collection of String objects. On a jsp, I want to list the strings. If my jsp has this: logic:iterate id=myId name=myBean property=myStrings bean:write name=myId/ /logic:iterate Then I get an exception Cannot find bean myId in any scope. I can understand that cos myId is a String not a bean. What should I use instead of bean:write ? Steve ___ Yahoo! Messenger - Communicate instantly...Ping your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Search - Find what youre looking for faster http://search.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Newbie question
Hi, I am new to struts. I found a number of simple tutorials (with examples) to understand struts-1.0, but there seems to none for struts-1.1. I have gone through one struts-1.0 tutorial given at jspfinder.com, which is good. Can you please recommend for struts-1.1 (with examples)? Thanks, Satya
Re: Newbie question
From the main page of Struts (the one you clicked past to subscribe to this list) http://jakarta.apache.org/struts/learning.html -- James Mitchell Software Engineer / Open Source Evangelist EdgeTech, Inc. 678.910.8017 AIM: jmitchtx MSN: [EMAIL PROTECTED] - Original Message - From: Satya Narayan Dash [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 03, 2004 9:31 AM Subject: Newbie question Hi, I am new to struts. I found a number of simple tutorials (with examples) to understand struts-1.0, but there seems to none for struts-1.1. I have gone through one struts-1.0 tutorial given at jspfinder.com, which is good. Can you please recommend for struts-1.1 (with examples)? Thanks, Satya - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ActionForm boolean properties - Newbie question
I have some trouble using a boolean (the primitive type) property inside an ActionForm. What I'd like to know is if Struts looks for a getProperty method or isProperty method... It seems Struts always calls the getProperty, but as I know it should call the isProperty!! Is the behavior with a Boolean (Object type) property the same ? Thanks everyone Renato Renato Romano Sistemi e Telematica S.p.A. Calata Grazie - Vial Al Molo Giano 16127 - GENOVA e-mail: [EMAIL PROTECTED] Tel.: 010 2712603 _ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: ActionForm boolean properties - Newbie question
If its a primitive , it will look for 'is' , but for the Boolean object it will look for 'get' (same as any other object). -Original Message- From: Renato Romano [mailto:[EMAIL PROTECTED] Sent: Tuesday, 20 January 2004 23:00 To: 'Struts Users Mailing List' Subject: ActionForm boolean properties - Newbie question I have some trouble using a boolean (the primitive type) property inside an ActionForm. What I'd like to know is if Struts looks for a getProperty method or isProperty method... It seems Struts always calls the getProperty, but as I know it should call the isProperty!! Is the behavior with a Boolean (Object type) property the same ? Thanks everyone Renato Renato Romano Sistemi e Telematica S.p.A. Calata Grazie - Vial Al Molo Giano 16127 - GENOVA e-mail: [EMAIL PROTECTED] Tel.: 010 2712603 _ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
newbie question : cannot resolve symbol when compiling an Action class
sorry for this newbie question, tried, googled, but can not find an anwser: I have a Action class (myAction) and a utility class (myABC class), in myAction, I try to instantiate it: myABC abc = new myABC (..); when compiling, error msg: ~~~ cannot reolve symbol symbol: constructor myABC location : class com.util.myABC what's wrong ? thanks ! li xin __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: newbie question : cannot resolve symbol when compiling an Action class
First, your class name should begin with a capital letter by convention. The error is saying that no constructor an be found that matches myABC (..). So, be sure there is such a constructor. - Original Message - From: lixin chu [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, January 19, 2004 10:04 AM Subject: newbie question : cannot resolve symbol when compiling an Action class sorry for this newbie question, tried, googled, but can not find an anwser: I have a Action class (myAction) and a utility class (myABC class), in myAction, I try to instantiate it: myABC abc = new myABC (..); when compiling, error msg: ~~~ cannot reolve symbol symbol: constructor myABC location : class com.util.myABC what's wrong ? thanks ! li xin __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: newbie question : cannot resolve symbol when compiling an Action class
yes, I changed to : public class MYABC { public void MYABC () { } other methods } still the same thing.. --- e-denton Java Programmer [EMAIL PROTECTED] wrote: First, your class name should begin with a capital letter by convention. The error is saying that no constructor an be found that matches myABC (..). So, be sure there is such a constructor. - Original Message - From: lixin chu [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, January 19, 2004 10:04 AM Subject: newbie question : cannot resolve symbol when compiling an Action class sorry for this newbie question, tried, googled, but can not find an anwser: I have a Action class (myAction) and a utility class (myABC class), in myAction, I try to instantiate it: myABC abc = new myABC (..); when compiling, error msg: ~~~ cannot reolve symbol symbol: constructor myABC location : class com.util.myABC what's wrong ? thanks ! li xin __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
newbie question/problem
I've been trying to modify the logon app from Struts in Action to use the new features in Struts 1.1 but am having a problem I haven't be able to solve. I replaced html:errors/ in Logon.jsp with html:messages id=error bean:write name=error/ /html:messages and get the following error: org.apache.jasper.JasperException: /pages/Logon.jsp(7,0) No such tag messages in the tag library imported with prefix html Of course it looks like I'm somehow referencing the 1.0 version of struts-html, but I don't see how that can be. In web.xml I've got: taglib taglib-uri/tags/struts-html/taglib-uri taglib-location/WEB-INF/lib/struts-html.tld/taglib-location /taglib and the struts-html.tld in /WEB-INF/lib contains: !DOCTYPE taglib PUBLIC -//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd; ... tag namemessages/name tagclassorg.apache.struts.taglib.html.MessagesTag/tagclass teiclassorg.apache.struts.taglib.html.MessagesTei/teiclass ... Any ideas??? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [other] newbie question/problem
How about your struts.jar? You might have multiple copies of it, and the one being picked up happens to be an older copy. -Original Message- From: Jim Anderson [mailto:[EMAIL PROTECTED] Sent: Monday, December 22, 2003 2:23 PM To: Struts Users Mailing List Cc: Jim Anderson Subject: [other] newbie question/problem I've been trying to modify the logon app from Struts in Action to use the new features in Struts 1.1 but am having a problem I haven't be able to solve. I replaced html:errors/ in Logon.jsp with html:messages id=error bean:write name=error/ /html:messages and get the following error: org.apache.jasper.JasperException: /pages/Logon.jsp(7,0) No such tag messages in the tag library imported with prefix html Of course it looks like I'm somehow referencing the 1.0 version of struts-html, but I don't see how that can be. In web.xml I've got: taglib taglib-uri/tags/struts-html/taglib-uri taglib-location/WEB-INF/lib/struts-html.tld/taglib-location /taglib and the struts-html.tld in /WEB-INF/lib contains: !DOCTYPE taglib PUBLIC -//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd; ... tag namemessages/name tagclassorg.apache.struts.taglib.html.MessagesTag/tagclass teiclassorg.apache.struts.taglib.html.MessagesTei/teiclass ... Any ideas??? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Utter Newbie Question
I'm making using struts for more or less than first time. I read the FAQ on how to handle logins to an application and I'm left with one question: Why stop a storing a Boolean in the session to determine logged-inness? Why not just store the (validated) User object in the session and check for it's presence? That way, if it's there, one can utilize the data in the User object for whatever sordid little purpose said developer comes up with. Is this a good idea? If so, how do I go about doing this in the view? (I told you I was a newbie!). I mean using bean:write tags of the User object seems straightforward enough, but what about the List of Children objects that is part of the User object? TIA -Joe - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Utter Newbie Question
Wednesday, November 12, 2003, 11:03:15 AM, you wrote: JH Why stop a storing a Boolean in the session to determine logged-inness? JH Why not just store the (validated) User object in the session and check for JH it's presence? That way, if it's there, one can utilize the data in the User JH object for whatever sordid little purpose said developer comes up with. That excactly what I'm doing. At the login, the business logic checks if the credentials supplied were right. If so, the user object will be stored in the session. In that way, I can easily access all the user's properties without doing a lookup all the time. You might run into memory problems if you have a lot of simultanous logged in users and/or big user objects. But that not the case for me. Additionally, I'm storing a list of the users group membership in the session. So I can do fast permission checks based on this list (always doing a lookup for every groups is expensive). JH I mean using bean:write tags of the User object seems straightforward JH enough, but what about the List of Children objects that is part of JH the User object? I don't really understand. I'm using code like this to access the user object: c:choose %-- check if the users object is stored in the session--% c:when test=${empty sessionScope.user} %-- it's not, present a you're not logged in message --% span id=errorbean:message key=login.header.unauthd//spanbr /c:when %-- the user is logged in --% c:otherwise %-- present a welcome message like Welcome, John Doe. --% bean:message key=login.header.welcome/, ${sessionScope.user.name}. %-- display the logout form --% html:form action=login.do html:hidden property=dispatch value=logout/ %-- the requested page parameter is used to return to this page after logout --% html:hidden property=requestedPage value=${pageContext.request.servletPath}/ html:submitbean:message key=login.button.logout//html:submit /html:form /c:otherwise /c:choose As you can see, I read and display the user's name with ${sessionScope.user.name}. But I have to warn you, I'm a struts newbie too.. :) Regards, Arne Brutschy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Newbie question....redirect
Hi all ! Sorry, about a such stupid question but I try to have my application redirects to an external web site with some parameters. Here is an exemple : http://payOnline/$cashAmout/$name For the moment i'm just try to redirect to an external website like yahoo but the search path is always /context/http://www.yahoo.fr;. What's wrong ? Here is a snipet from struts-config.xml : action path = /Bonjour type = BonjourAction name = BonjourForm scope = request input = /index.jsp validate = true forward name=oui path=http://www.yahoo.fr; contextRelative=false redirect=true/ /action Environment : struts 1.1, tomcat 4.1.27, jdk 1.4.2_02
Re: Newbie question....redirect
contextRelative is used to define a forward that is relative to the application context and not to the module context (default). You cannot redirect to an URL outside your app using struts-config forward. Use a requestDispatcher in your action and call sendRedirect(), or create a new JSP with a html:redirect href=http://www.yahoo.com; tag Nico. - Original Message - From: Mathieu Grimault [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 2:16 PM Subject: Newbie questionredirect Hi all ! Sorry, about a such stupid question but I try to have my application redirects to an external web site with some parameters. Here is an exemple : http://payOnline/$cashAmout/$name For the moment i'm just try to redirect to an external website like yahoo but the search path is always /context/http://www.yahoo.fr;. What's wrong ? Here is a snipet from struts-config.xml : action path = /Bonjour type = BonjourAction name = BonjourForm scope = request input = /index.jsp validate = true forward name=oui path=http://www.yahoo.fr; contextRelative=false redirect=true/ /action Environment : struts 1.1, tomcat 4.1.27, jdk 1.4.2_02 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Newbie question....redirect
Nicolas, I think your reply will help me with my post too - trying to switch web modules - help but I don't see a sendRedirect() method of the requestDispatcher object. How can I call this sendRedirect() - sounds like the solution to my problem! Thanks From: Nicolas De Loof [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Newbie questionredirect Date: Wed, 5 Nov 2003 14:22:47 +0100 contextRelative is used to define a forward that is relative to the application context and not to the module context (default). You cannot redirect to an URL outside your app using struts-config forward. Use a requestDispatcher in your action and call sendRedirect(), or create a new JSP with a html:redirect href=http://www.yahoo.com; tag Nico. - Original Message - From: Mathieu Grimault [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 2:16 PM Subject: Newbie questionredirect Hi all ! Sorry, about a such stupid question but I try to have my application redirects to an external web site with some parameters. Here is an exemple : http://payOnline/$cashAmout/$name For the moment i'm just try to redirect to an external website like yahoo but the search path is always /context/http://www.yahoo.fr;. What's wrong ? Here is a snipet from struts-config.xml : action path = /Bonjour type = BonjourAction name = BonjourForm scope = request input = /index.jsp validate = true forward name=oui path=http://www.yahoo.fr; contextRelative=false redirect=true/ /action Environment : struts 1.1, tomcat 4.1.27, jdk 1.4.2_02 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Is your computer infected with a virus? Find out with a FREE computer virus scan from McAfee. Take the FreeScan now! http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Newbie question....redirect
excuse me for mistake. You should read response.sendRedirect() http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/http/HttpServletResponse.html#sendRedirect(java.lang.String) Nico. - Original Message - From: Marcella Turner [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 4:06 PM Subject: Re: Newbie questionredirect Nicolas, I think your reply will help me with my post too - trying to switch web modules - help but I don't see a sendRedirect() method of the requestDispatcher object. How can I call this sendRedirect() - sounds like the solution to my problem! Thanks From: Nicolas De Loof [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Newbie questionredirect Date: Wed, 5 Nov 2003 14:22:47 +0100 contextRelative is used to define a forward that is relative to the application context and not to the module context (default). You cannot redirect to an URL outside your app using struts-config forward. Use a requestDispatcher in your action and call sendRedirect(), or create a new JSP with a html:redirect href=http://www.yahoo.com; tag Nico. - Original Message - From: Mathieu Grimault [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 2:16 PM Subject: Newbie questionredirect Hi all ! Sorry, about a such stupid question but I try to have my application redirects to an external web site with some parameters. Here is an exemple : http://payOnline/$cashAmout/$name For the moment i'm just try to redirect to an external website like yahoo but the search path is always /context/http://www.yahoo.fr;. What's wrong ? Here is a snipet from struts-config.xml : action path = /Bonjour type = BonjourAction name = BonjourForm scope = request input = /index.jsp validate = true forward name=oui path=http://www.yahoo.fr; contextRelative=false redirect=true/ /action Environment : struts 1.1, tomcat 4.1.27, jdk 1.4.2_02 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Is your computer infected with a virus? Find out with a FREE computer virus scan from McAfee. Take the FreeScan now! http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Newbie question: how to reload the struts config file without rebooting tomcat?
Hello all, how do I reload changes to the struts config file without rebooting tomcat? kind regards, Geert -Original Message- From: Frers Michael [mailto:[EMAIL PROTECTED] Sent: woensdag 29 oktober 2003 9:49 To: Struts Users Mailing List Subject: Re: a query regarding message-resources Hello on my first look: shouldnt u use message-resources property=languages / i think there is a missing s - Original Message - From: Mahin Jeyachandran [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, October 29, 2003 4:57 AM Subject: a query regarding message-resources good day all, I'm new to struts frame work... I'm using a property file names languages.properties instead of ApplicationResources.properties Also I have an entry in my struts-config.xml like the following... message-resources property=language / I also placed the property file in WEB-INF/classes/ but it seems that the property file languages.properties is not detected. shld I make any changes or any entry in the web.xml to make my new property file visible I'm using web-logic6.1. pls help.. Regards, Mahin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts newbie question
I have a form that has two select boxes. One need to be pre-populated on load. The second will be populated when a use selects one of the elements in the first list. Can this be accomplished and if so how? I would really like to use DynaActionForms if possible. Nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: newbie question: results display on same page?
Hi, Though I am also a newbie, when I faced a similar problem, I used bean:define id=myId I am not very sure whether it will work for you. I tried a few other options before finally getting the result, as none answered my question on struts user list... I only can hope it helps...not sure anhow.. good luck jag --- mobile q [EMAIL PROTECTED] wrote: thankyou for your reply. I did put results bean into request. The problem is: it even does not display search form now if I put results display block after /html:form since user has not pressed get button. Here is my display code: table logic:iterate id=... name =... property .. /logic:... /table I only use bean:write tag to output individual table data. I also tried to put the above code inside html:form tag, and use logic:present to chech if results bean is present. I still could not display search form and got null: logic:present name=resultsBean property=resultsBean scope=session /logic:... According to api, if resultsBean is not present, it should check non-null results, and let search form dislay, right? dun know why it did not work.. --- Nicholson, Robb [EMAIL PROTECTED] wrote: The logic:iterate tag does not have to live within a form. Chances are your error is because the Collection you are trying to iterate over is not in the request (or whatever session you happen to be using). What we normally do for a situation like this is to create a JSP with the search form, and another with the results iterator. Then use TILES to pull them together on one page. It's flexible enough so you can reuse one or more component elsewhere, or change your mind and separate them later, etc. -Original Message- From: mobile q [mailto:[EMAIL PROTECTED] Sent: Monday, October 13, 2003 2:04 PM To: [EMAIL PROTECTED] Subject: newbie question: results display on same page? Hi, I am working on a page which has a user search form, the results should be displayed at the bottom of the page once user clicks on get button. I try to use logic:iterate tag to do the job. My problem: if I include this display loop inside html:form, it tells me the results are null when I navigate to this page since user has not pushed get button. If I put results dipslay code right after /html:form, it tells me Cannot find bean org.apache.struts.taglib.html.BEAN in any scope since logic:iterate tag is not used inside html:form tag. I do not know how to resolve this conflict. Should I use multiple forms to do this? Not really sure. Really need your wise advices. __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Yahoo! India Matrimony: Find your partner online. Go to http://yahoo.shaadi.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
hashtable newbie question
Hi, I want to define a bean name called myBean which contains view hashtable. How can I approach it in jsp file? like this? bean:define id=myBean ?? /bean:define Thanks in advance. --Zoe CONFIDENTIALITY NOTICE: The information in this e-mail is privileged and confidential. Any use, copying or dissemination of any portion of this e-mail by or to anyone other than the intended recipient(s) is unauthorized. If you have received this e-mail in error, please reply to sender and delete it from your system immediately. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
newbie question: results display on same page?
Hi, I am working on a page which has a user search form, the results should be displayed at the bottom of the page once user clicks on get button. I try to use logic:iterate tag to do the job. My problem: if I include this display loop inside html:form, it tells me the results are null when I navigate to this page since user has not pushed get button. If I put results dipslay code right after /html:form, it tells me Cannot find bean org.apache.struts.taglib.html.BEAN in any scope since logic:iterate tag is not used inside html:form tag. I do not know how to resolve this conflict. Should I use multiple forms to do this? Not really sure. Really need your wise advices. __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: newbie question: results display on same page?
The logic:iterate tag does not have to live within a form. Chances are your error is because the Collection you are trying to iterate over is not in the request (or whatever session you happen to be using). What we normally do for a situation like this is to create a JSP with the search form, and another with the results iterator. Then use TILES to pull them together on one page. It's flexible enough so you can reuse one or more component elsewhere, or change your mind and separate them later, etc. -Original Message- From: mobile q [mailto:[EMAIL PROTECTED] Sent: Monday, October 13, 2003 2:04 PM To: [EMAIL PROTECTED] Subject: newbie question: results display on same page? Hi, I am working on a page which has a user search form, the results should be displayed at the bottom of the page once user clicks on get button. I try to use logic:iterate tag to do the job. My problem: if I include this display loop inside html:form, it tells me the results are null when I navigate to this page since user has not pushed get button. If I put results dipslay code right after /html:form, it tells me Cannot find bean org.apache.struts.taglib.html.BEAN in any scope since logic:iterate tag is not used inside html:form tag. I do not know how to resolve this conflict. Should I use multiple forms to do this? Not really sure. Really need your wise advices. __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: newbie question: results display on same page?
thankyou for your reply. I did put results bean into request. The problem is: it even does not display search form now if I put results display block after /html:form since user has not pressed get button. Here is my display code: table logic:iterate id=... name =... property .. /logic:... /table I only use bean:write tag to output individual table data. I also tried to put the above code inside html:form tag, and use logic:present to chech if results bean is present. I still could not display search form and got null: logic:present name=resultsBean property=resultsBean scope=session /logic:... According to api, if resultsBean is not present, it should check non-null results, and let search form dislay, right? dun know why it did not work.. --- Nicholson, Robb [EMAIL PROTECTED] wrote: The logic:iterate tag does not have to live within a form. Chances are your error is because the Collection you are trying to iterate over is not in the request (or whatever session you happen to be using). What we normally do for a situation like this is to create a JSP with the search form, and another with the results iterator. Then use TILES to pull them together on one page. It's flexible enough so you can reuse one or more component elsewhere, or change your mind and separate them later, etc. -Original Message- From: mobile q [mailto:[EMAIL PROTECTED] Sent: Monday, October 13, 2003 2:04 PM To: [EMAIL PROTECTED] Subject: newbie question: results display on same page? Hi, I am working on a page which has a user search form, the results should be displayed at the bottom of the page once user clicks on get button. I try to use logic:iterate tag to do the job. My problem: if I include this display loop inside html:form, it tells me the results are null when I navigate to this page since user has not pushed get button. If I put results dipslay code right after /html:form, it tells me Cannot find bean org.apache.struts.taglib.html.BEAN in any scope since logic:iterate tag is not used inside html:form tag. I do not know how to resolve this conflict. Should I use multiple forms to do this? Not really sure. Really need your wise advices. __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html tag newbie question
Hi, I am very new in struts and facing a problem now. Please help. What I want to do is when user click a image, it will link to yahoo.com which is defined as link.yahoo in the config property file. How can I approach this? After it generate the html source codes, it will be like a href=http://www.yahoo.com;img src=../images/yahoo.gif alt=Yahoo/a Right now, I am doing a wrong way to combine struts and html even though it's working fine. --in property file-- link.yahoo=a href=http://www.yahoo.com/ image.yahoo=../images/yahoo.gif image.yahoo.alt=Yahoo --in jsp -- bean:message key=link.yahoo /html:img srcKey=image.yahoo altKey=image.yahoo.alt //a CONFIDENTIALITY NOTICE: The information in this e-mail is privileged and confidential. Any use, copying or dissemination of any portion of this e-mail by or to anyone other than the intended recipient(s) is unauthorized. If you have received this e-mail in error, please reply to sender and delete it from your system immediately. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html tag newbie question
have a look at html:link tag documentation ...And try to use the struts tags as much as possible... -Original Message- From: Peng, Meimin [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2003 5:23 PM To: 'Struts Users Mailing List' Subject: html tag newbie question Hi, I am very new in struts and facing a problem now. Please help. What I want to do is when user click a image, it will link to yahoo.com which is defined as link.yahoo in the config property file. How can I approach this? After it generate the html source codes, it will be like a href=http://www.yahoo.com;img src=../images/yahoo.gif alt=Yahoo/a Right now, I am doing a wrong way to combine struts and html even though it's working fine. --in property file-- link.yahoo=a href=http://www.yahoo.com/ image.yahoo=../images/yahoo.gif image.yahoo.alt=Yahoo --in jsp -- bean:message key=link.yahoo /html:img srcKey=image.yahoo altKey=image.yahoo.alt //a CONFIDENTIALITY NOTICE: The information in this e-mail is privileged and confidential. Any use, copying or dissemination of any portion of this e-mail by or to anyone other than the intended recipient(s) is unauthorized. If you have received this e-mail in error, please reply to sender and delete it from your system immediately. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html tag newbie question
Hi, I still don't know how to do it. I try to avoid hard code anything, have any logic, have html tag, and have javascripts in jsp file. Overall, jsp file will just display whatever I got from properties or beans. Is there a way to do like this for example: html:link href=bean:message key=link.yahoo/images/html:link then link.yahoo will be http://www.yahoo.com/ any ideas? Thanks. -Original Message- have a look at html:link tag documentation ...And try to use the struts tags as much as possible... -Original Message- Hi, I am very new in struts and facing a problem now. Please help. What I want to do is when user click a image, it will link to yahoo.com which is defined as link.yahoo in the config property file. How can I approach this? After it generate the html source codes, it will be like a href=http://www.yahoo.com;img src=../images/yahoo.gif alt=Yahoo/a Right now, I am doing a wrong way to combine struts and html even though it's working fine. --in property file-- link.yahoo=a href=http://www.yahoo.com/ image.yahoo=../images/yahoo.gif image.yahoo.alt=Yahoo --in jsp -- bean:message key=link.yahoo /html:img srcKey=image.yahoo altKey=image.yahoo.alt //a CONFIDENTIALITY NOTICE: The information in this e-mail is privileged and confidential. Any use, copying or dissemination of any portion of this e-mail by or to anyone other than the intended recipient(s) is unauthorized. If you have received this e-mail in error, please reply to sender and delete it from your system immediately. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
newbie question: how to handle two dispatchAction methods in a jsp page?
Hi, guys: I have two methods in a DispatchAction class: save, delete and I have two buttons in a jsp page: save, delete. In order to successfully save and then forward to another page, I can do the following: html:submitbean:message key=button.save//html:submit html:hidden property=method value=save/ This works fine. But if I add code related with delete method just following the above code: html:submitbean:message key=button.delete//html:submit html:hidden property=method value=delete/ Everything fails. I am wondering how I can handle multiple DispatchAction methods in a jsp page? regards, __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: newbie question: how to handle two dispatchAction methods in a jsp page?
Hi Victor, If you have both html:hidden property=method/ and buttons in the same form, both method are submitted when you pressed either button. You could change the value with javascript code before submitting the form. Something like this might work : html:hidden property=method value=save/ html:submit bean:messagekey=button.save/ /html:submit html:submit onclick=document.formName.method.value='delete' bean:message key=button.delete/ /html:submit -Original Message- From: victor gusz [mailto:[EMAIL PROTECTED] Sent: Friday, September 12, 2003 13:33 To: [EMAIL PROTECTED] Subject: newbie question: how to handle two dispatchAction methods in a jsp page? Hi, guys: I have two methods in a DispatchAction class: save, delete and I have two buttons in a jsp page: save, delete. In order to successfully save and then forward to another page, I can do the following: html:submitbean:message key=button.save//html:submit html:hidden property=method value=save/ This works fine. But if I add code related with delete method just following the above code: html:submitbean:message key=button.delete//html:submit html:hidden property=method value=delete/ Everything fails. I am wondering how I can handle multiple DispatchAction methods in a jsp page? regards, __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: newbie question: how to handle two dispatchAction methods in a jsp page?
Hi, Jerome: Thanks for helping. I tried out your code. Strangely, if I click on either save button, or delete button, now they both forward to save page. It seems action still forwards to save method even I clicks on delete button. Any idea? regards, --- Jerome Devost [EMAIL PROTECTED] wrote: Hi Victor, If you have both html:hidden property=method/ and buttons in the same form, both method are submitted when you pressed either button. You could change the value with javascript code before submitting the form. Something like this might work : html:hidden property=method value=save/ html:submit bean:messagekey=button.save/ /html:submit html:submit onclick=document.formName.method.value='delete' bean:message key=button.delete/ /html:submit -Original Message- From: victor gusz [mailto:[EMAIL PROTECTED] Sent: Friday, September 12, 2003 13:33 To: [EMAIL PROTECTED] Subject: newbie question: how to handle two dispatchAction methods in a jsp page? Hi, guys: I have two methods in a DispatchAction class: save, delete and I have two buttons in a jsp page: save, delete. In order to successfully save and then forward to another page, I can do the following: html:submitbean:message key=button.save//html:submit html:hidden property=method value=save/ This works fine. But if I add code related with delete method just following the above code: html:submitbean:message key=button.delete//html:submit html:hidden property=method value=delete/ Everything fails. I am wondering how I can handle multiple DispatchAction methods in a jsp page? regards, __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: newbie question: how to handle two dispatchAction methods in a jsp page?
If you need to change the action of the form, you can do this in the onclick event : document.formName.action = /delete.do If you change the action, you probably won't need the method parameter then. Be sure that you do not have an element in your form called 'action', otherwise it will confuse Internet Explorer. -Original Message- From: victor gusz [mailto:[EMAIL PROTECTED] Sent: Friday, September 12, 2003 14:04 To: Struts Users Mailing List Subject: RE: newbie question: how to handle two dispatchAction methods in a jsp page? Hi, Jerome: Thanks for helping. I tried out your code. Strangely, if I click on either save button, or delete button, now they both forward to save page. It seems action still forwards to save method even I clicks on delete button. Any idea? regards, --- Jerome Devost [EMAIL PROTECTED] wrote: Hi Victor, If you have both html:hidden property=method/ and buttons in the same form, both method are submitted when you pressed either button. You could change the value with javascript code before submitting the form. Something like this might work : html:hidden property=method value=save/ html:submit bean:messagekey=button.save/ /html:submit html:submit onclick=document.formName.method.value='delete' bean:message key=button.delete/ /html:submit -Original Message- From: victor gusz [mailto:[EMAIL PROTECTED] Sent: Friday, September 12, 2003 13:33 To: [EMAIL PROTECTED] Subject: newbie question: how to handle two dispatchAction methods in a jsp page? Hi, guys: I have two methods in a DispatchAction class: save, delete and I have two buttons in a jsp page: save, delete. In order to successfully save and then forward to another page, I can do the following: html:submitbean:message key=button.save//html:submit html:hidden property=method value=save/ This works fine. But if I add code related with delete method just following the above code: html:submitbean:message key=button.delete//html:submit html:hidden property=method value=delete/ Everything fails. I am wondering how I can handle multiple DispatchAction methods in a jsp page? regards, __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
newbie question
I have two jsp pages. sicpage0.jsp and sicpage1.jsp sicpage0 is a static page. when I submit sicpage0, it calls an action class which populates sicpage1.jsp with data. Now I want to call sicpage1.jsp directly without first calling sicpage0.jsp. But sicpage1.jsp is not getting populated with data since the action class is not getting called. Can someone help me please? TIA, Venkat - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: newbie question
Now I want to call sicpage1.jsp directly without first calling sicpage0.jsp. But sicpage1.jsp is not getting populated with data since the action class is not getting called. create a global forward to the action, and call the forward. -- Bryce Fischer [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Newbie question: Testing if collection is != null before iterating
How can I test if a collection is not null before iterating through it? Does the logic:iterate tag do this ckeck and skip the iteration if the collection is null? Thanks a lot, Todor - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie question: Testing if collection is != null before iterating
Check logic:notEmpty tag -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Todor Sergueev Petkov Sent: Saturday, August 09, 2003 12:32 PM To: Struts Users Mailing List Subject: Newbie question: Testing if collection is != null before iterating How can I test if a collection is not null before iterating through it? Does the logic:iterate tag do this ckeck and skip the iteration if the collection is null? Thanks a lot, Todor - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Newbie question, dynamic select boxes
Hi you all, i'm starting with struts and after reading and testing a bit, i have a question. Suppose I create a form where the user should choose a car model, for example, lets say model1, model2 and model3. Suppose that i need to get that models of a database. And suppose too that after the user choose the model i want to store that reference in my database. Which is the best way to implement such things? Where should i retrieve the values from the database? maybe in the form bean? Really, i think my question is: what to do when I need to show in a form dynamic data coming directly from the storage medium? Sorry if the question it's quite obvious but i'm a bit lost :) -- Saludos, Chema. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: newbie-question: validation across multiple pages
You might want to use session to store all the values entered in page=1. Then when there is an error in page=2 or page=3, and forward the control back to page=1. Since all the values are session scope, you can access them in your page=1. Remember you have to clean the session though:). if(! errors.isEmpty()) { ... return (new ActionForward(page1)); } -Original Message- From: Sebastian F. Martin [mailto:[EMAIL PROTECTED] Sent: July 30, 2003 10:29 AM To: [EMAIL PROTECTED] Subject: newbie-question: validation across multiple pages Hi all, I've been studying the mailing list but couldn't find anything that would help me. I'd be grateful if someone could give me a hint on this: I am collecting user input across multiple pages and validate it in the validate() method of the ActionForm. If an input field on the second or the third page is empty after submit, the framework will take me back to the first page. How can I make him turn me back to the page where the input field was left blank? Greetings Sebastian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
newbie-question: validation across multiple pages
Hi all, I've been studying the mailing list but couldn't find anything that would help me. I'd be grateful if someone could give me a hint on this: I am collecting user input across multiple pages and validate it in the validate() method of the ActionForm. If an input field on the second or the third page is empty after submit, the framework will take me back to the first page. How can I make him turn me back to the page where the input field was left blank? Greetings Sebastian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Newbie question :Rendering buttons of type submit and button
Hi all, How do you render following html with the help of struts-html tld : input type=submit name=Save value =Save input type=button name=Cancel value =Cancel I don't have any other info like other parameters to include on pressing any of the buttons . Thanks, Jitesh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie question :Rendering buttons of type submit and button
http://jakarta.apache.org/struts/userGuide/struts-html.html#submit input type=submit name=Save value =Save in struts becomes: html:submit property=Save value=Save / http://jakarta.apache.org/struts/userGuide/struts-html.html#button input type=button name=Cancel value =Cancel in struts becomes: html:button property=Cancel value=Cancel / Hope this helps! --- - Nayan Hajratwala - Chikli Consulting LLC - http://www.chikli.com -Original Message- From: Jitesh Sinha [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 29, 2003 12:24 PM To: Struts Users Mailing List Subject: Newbie question :Rendering buttons of type submit and button Hi all, How do you render following html with the help of struts-html tld : input type=submit name=Save value =Save input type=button name=Cancel value =Cancel I don't have any other info like other parameters to include on pressing any of the buttons . Thanks, Jitesh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: newbie question!
Hi I couldn't spot anything wrong below, did you get any runtime exceptions? If so, show a snippet. --Alen Hello, This question probably might have been asked many a times. But I searched the archive (though not fully) but could not find this. So, if anybody has a solution please do let me know. I have developed a sample application, which takes in an input and based on that displays either a success page or failure page. The problem am facing is the servlet is not being called. Below is the sturts.config.xml, b.xml and index.jsp. Am using jdk1.4.0 and tomcat 4.1.12. The java class files are under WEB-INF\classes\myapp package. Thanx for you help. == index.jsp %@ page language=java% %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % html head title \First Struts Application/title /head body html:form action=/Lookup name=lookupForm type=myapp.LookupForm Symbol nbsp nbsp html:text property=symbol / br br html:submit/ /html:form /body /html == = web.xml ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN http://java.sun.com/j2ee/dtds/web-app_2_3.dtd; web-app servlet servlet-nameaction/servlet-name servlet-class org.apache.struts.action.ActionServlet /servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param load-on-startup1/load-on-startup /servlet !-- Standard Action Servlet Mapping-- servlet-mapping servlet-nameaction/servlet-name url-pattern*.do/url-pattern /servlet-mapping taglib taglib-uri/WEB-INF/struts-html.tld/taglib-uri taglib-location/WEB-INF/struts-html.tld/taglib-location /taglib /web-app == struts-config.xml ?xml version=1.0 encoding=ISO-8859-1 ? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.1//EN http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd; struts-config message-resources parameter=myapp.ApplicationResources/ form-beans form-bean name=lookupForm type=myapp.LookupForm/ /form-beans action-mappings action path=/Lookup name=lookupForm type=myapp.LookupAction input=/index.jsp forward name =success path=/quote.jsp/ forward name=failure path =/index.jsp/ /action /action-mappings /struts-config -- Regards, Samanth Athrey, Azikewe Systems, www.azikewe.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: newbie question!
Hi, There are no exceptions at all! Once the FormBean is executed the control is not passed on to the Servlet! Regards, Samanth Athrey Alen Ribic [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi I couldn't spot anything wrong below, did you get any runtime exceptions? If so, show a snippet. --Alen Hello, This question probably might have been asked many a times. But I searched the archive (though not fully) but could not find this. So, if anybody has a solution please do let me know. I have developed a sample application, which takes in an input and based on that displays either a success page or failure page. The problem am facing is the servlet is not being called. Below is the sturts.config.xml, b.xml and index.jsp. Am using jdk1.4.0 and tomcat 4.1.12. The java class files are under WEB-INF\classes\myapp package. Thanx for you help. == index.jsp %@ page language=java% %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % html head title \First Struts Application/title /head body html:form action=/Lookup name=lookupForm type=myapp.LookupForm Symbol nbsp nbsp html:text property=symbol / br br html:submit/ /html:form /body /html == = web.xml ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN http://java.sun.com/j2ee/dtds/web-app_2_3.dtd; web-app servlet servlet-nameaction/servlet-name servlet-class org.apache.struts.action.ActionServlet /servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param load-on-startup1/load-on-startup /servlet !-- Standard Action Servlet Mapping-- servlet-mapping servlet-nameaction/servlet-name url-pattern*.do/url-pattern /servlet-mapping taglib taglib-uri/WEB-INF/struts-html.tld/taglib-uri taglib-location/WEB-INF/struts-html.tld/taglib-location /taglib /web-app == struts-config.xml ?xml version=1.0 encoding=ISO-8859-1 ? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.1//EN http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd; struts-config message-resources parameter=myapp.ApplicationResources/ form-beans form-bean name=lookupForm type=myapp.LookupForm/ /form-beans action-mappings action path=/Lookup name=lookupForm type=myapp.LookupAction input=/index.jsp forward name =success path=/quote.jsp/ forward name=failure path =/index.jsp/ /action /action-mappings /struts-config -- Regards, Samanth Athrey, Azikewe Systems, www.azikewe.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
newbie question!
Hello, This question probably might have been asked many a times. But I searched the archive (though not fully) but could not find this. So, if anybody has a solution please do let me know. I have developed a sample application, which takes in an input and based on that displays either a success page or failure page. The problem am facing is the servlet is not being called. Below is the sturts.config.xml, b.xml and index.jsp. Am using jdk1.4.0 and tomcat 4.1.12. The java class files are under WEB-INF\classes\myapp package. Thanx for you help. == index.jsp %@ page language=java% %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % html head title \First Struts Application/title /head body html:form action=/Lookup name=lookupForm type=myapp.LookupForm Symbol nbsp nbsp html:text property=symbol / br br html:submit/ /html:form /body /html == = web.xml ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN http://java.sun.com/j2ee/dtds/web-app_2_3.dtd; web-app servlet servlet-nameaction/servlet-name servlet-class org.apache.struts.action.ActionServlet /servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param load-on-startup1/load-on-startup /servlet !-- Standard Action Servlet Mapping-- servlet-mapping servlet-nameaction/servlet-name url-pattern*.do/url-pattern /servlet-mapping taglib taglib-uri/WEB-INF/struts-html.tld/taglib-uri taglib-location/WEB-INF/struts-html.tld/taglib-location /taglib /web-app == struts-config.xml ?xml version=1.0 encoding=ISO-8859-1 ? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.1//EN http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd; struts-config message-resources parameter=myapp.ApplicationResources/ form-beans form-bean name=lookupForm type=myapp.LookupForm/ /form-beans action-mappings action path=/Lookup name=lookupForm type=myapp.LookupAction input=/index.jsp forward name =success path=/quote.jsp/ forward name=failure path =/index.jsp/ /action /action-mappings /struts-config -- Regards, Samanth Athrey, Azikewe Systems, www.azikewe.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
newbie question: how to get context path?
Sorry for the newbie question... my brain not responding... Using mapping.findForward(xxx).getPath(), I am able to to get the the context-relative path. But how do I get the full path, eg. http://localhost:8080/myApp/xxx.do ? Regards, Daniel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: newbie question: how to get context path?
-Original Message- From: Daniel Joshua [mailto:[EMAIL PROTECTED] Sent: 25 July 2003 10:48 To: 'Struts Users Mailing List' Subject: newbie question: how to get context path? Sorry for the newbie question... my brain not responding... Using mapping.findForward(xxx).getPath(), I am able to to get the the context-relative path. But how do I get the full path, eg. http://localhost:8080/myApp/xxx.do ? HttpServletRequest.getRequestURL() -- Mike W - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: newbie question: how to get context path?
Oooops... thanks! Regards, Daniel -Original Message- From: Mike Whittaker [mailto:[EMAIL PROTECTED] Sent: Friday, 25 July, 2003 5:54 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: newbie question: how to get context path? -Original Message- From: Daniel Joshua [mailto:[EMAIL PROTECTED] Sent: 25 July 2003 10:48 To: 'Struts Users Mailing List' Subject: newbie question: how to get context path? Sorry for the newbie question... my brain not responding... Using mapping.findForward(xxx).getPath(), I am able to to get the the context-relative path. But how do I get the full path, eg. http://localhost:8080/myApp/xxx.do ? HttpServletRequest.getRequestURL() -- Mike W - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
newbie question: Java array to JavaScript Array
Hi, I did not put my question in a nice method previously. I am trying to retrieve data from database and pass data into a JavaScript function as an Array and display it on my JSP page. If I have to write a Scriptlet inside JavaScript code to get data from db, what kind of Java data form (ArrayList, Vector, Enemeration, List, Collection?) I can use to directly pass it into javascript function? If the above cannot work, How can I transform a Java array (a array of strings) into a JavaScript Array? Thank you in advance. regards, rick __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: newbie question: Java array to JavaScript Array
You'll need to do a couple of things: 1) (Assuming you're using Struts, of course.) Create your Java array/collection/whatever in the Action that gets hit before your JSP page: List myList = new ArrayList(); // populate the list, la la la request.addAttribute(listForJavascript, myList); return mapping.findForward(success); // Takes you to, say, bongabonga.jsp 2) In bongabonga.jsp: head script type=text/javascript var jsArray = new Array(); // Do you have to init this? I don't remember. logic:iterate id=jsList name=listForJavaScript indexId=idx jsArray[%=idx%] = %=jsList.getYourValue()%; /logic:iterate /script 3) Debug. This is all from memory. I'm sure there are some glaring errors here, but this is the general flow. -= J -Original Message- From: Rick Col [mailto:[EMAIL PROTECTED] Sent: Friday, July 25, 2003 9:56 AM To: [EMAIL PROTECTED] Subject: newbie question: Java array to JavaScript Array Hi, I did not put my question in a nice method previously. I am trying to retrieve data from database and pass data into a JavaScript function as an Array and display it on my JSP page. If I have to write a Scriptlet inside JavaScript code to get data from db, what kind of Java data form (ArrayList, Vector, Enemeration, List, Collection?) I can use to directly pass it into javascript function? If the above cannot work, How can I transform a Java array (a array of strings) into a JavaScript Array? Thank you in advance. regards, rick __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: newbie question: Java array to JavaScript Array
James: Thanks for your nice presentation. I will try it out right away. regards, rick --- James Childers [EMAIL PROTECTED] wrote: You'll need to do a couple of things: 1) (Assuming you're using Struts, of course.) Create your Java array/collection/whatever in the Action that gets hit before your JSP page: List myList = new ArrayList(); // populate the list, la la la request.addAttribute(listForJavascript, myList); return mapping.findForward(success); // Takes you to, say, bongabonga.jsp 2) In bongabonga.jsp: head script type=text/javascript var jsArray = new Array(); // Do you have to init this? I don't remember. logic:iterate id=jsList name=listForJavaScript indexId=idx jsArray[%=idx%] = %=jsList.getYourValue()%; /logic:iterate /script 3) Debug. This is all from memory. I'm sure there are some glaring errors here, but this is the general flow. -= J __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: newbie question: Java array to JavaScript Array
More questions about the following: 1) It says in logic tags reference: id: The name of a page scope JSP bean that will contain the current element of the collection on each iteration, if it is not null. So, it means myList ArrayList should conform to JavaBean routines, is that right? For example: If I have a List4Js class, it has to have getters/seters for getting/setting ArrayLists: ArrayList myList = List4J.getResultList(); And the elements of an ArrayList should be a bean too. 2) If I want to get a collection of arraylists, I can use the logic:iterate tag as following: logic:iterate id=jsList name=listForJavaScript indexId=idx logic:iterate id=myBean name=jsList indexId=index jsArray[%=idx%][%=index%] = %=myBean.getYourValue()%; /logic:iterate /logic:iterate Since JavaScript Array usually has the following form: myArray = new Array(sample, 1); Do I need to conform to the above routine to create an JavaScript Array element in order to correctly display the results? regards, rick --- James Childers [EMAIL PROTECTED] wrote: You'll need to do a couple of things: 1) (Assuming you're using Struts, of course.) Create your Java array/collection/whatever in the Action that gets hit before your JSP page: List myList = new ArrayList(); // populate the list, la la la request.addAttribute(listForJavascript, myList); return mapping.findForward(success); // Takes you to, say, bongabonga.jsp 2) In bongabonga.jsp: head script type=text/javascript var jsArray = new Array(); // Do you have to init this? I don't remember. logic:iterate id=jsList name=listForJavaScript indexId=idx jsArray[%=idx%] = %=jsList.getYourValue()%; /logic:iterate /script 3) Debug. This is all from memory. I'm sure there are some glaring errors here, but this is the general flow. -= J __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Newbie Question: Dyanamic JavaScript Array - Form Bean]
Hey everyone, I'm new to Struts and was wondering if anyone has ever attempted to create a dynamic HTML table (using JavaScript) that gets and sets values contained in a form bean from a JavaScript array when rows in the table are being added or deleted and upon the form being submitted. Thanks in advance - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: newbie question: Java array to JavaScript Array
Hi, I did the following, but the results were not displayed. Whats wrong with my code? products is a collection of ArrayLists, every arrayList contains a list of ProductBeans, ProductBean has productName and productId properties. products are retrieved in action class and are put into session scope: session.setAttribute(products, products); var productsArray = new Array(); logic:iterate id = aList name = products indexId = idx logic:iterate id = ProductBean name = aList indexId = index productsArray[%=idx%][%=index%] = new Array(bean:write name = ProductBean property = productName/, bean:write name = ProductBean property = productId/); /logic:iterate /logic:iterate Thanks in advance. rick --- Rick Col [EMAIL PROTECTED] wrote: More questions about the following: 1) It says in logic tags reference: id: The name of a page scope JSP bean that will contain the current element of the collection on each iteration, if it is not null. So, it means myList ArrayList should conform to JavaBean routines, is that right? For example: If I have a List4Js class, it has to have getters/seters for getting/setting ArrayLists: ArrayList myList = List4J.getResultList(); And the elements of an ArrayList should be a bean too. 2) If I want to get a collection of arraylists, I can use the logic:iterate tag as following: logic:iterate id=jsList name=listForJavaScript indexId=idx logic:iterate id=myBean name=jsList indexId=index jsArray[%=idx%][%=index%] = %=myBean.getYourValue()%; /logic:iterate /logic:iterate Since JavaScript Array usually has the following form: myArray = new Array(sample, 1); Do I need to conform to the above routine to create an JavaScript Array element in order to correctly display the results? regards, rick --- James Childers [EMAIL PROTECTED] wrote: You'll need to do a couple of things: 1) (Assuming you're using Struts, of course.) Create your Java array/collection/whatever in the Action that gets hit before your JSP page: List myList = new ArrayList(); // populate the list, la la la request.addAttribute(listForJavascript, myList); return mapping.findForward(success); // Takes you to, say, bongabonga.jsp 2) In bongabonga.jsp: head script type=text/javascript var jsArray = new Array(); // Do you have to init this? I don't remember. logic:iterate id=jsList name=listForJavaScript indexId=idx jsArray[%=idx%] = %=jsList.getYourValue()%; /logic:iterate /script 3) Debug. This is all from memory. I'm sure there are some glaring errors here, but this is the general flow. -= J __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: newbie question: Java array to JavaScript Array
Man, this is really sick ;-). If I'm understanding you, maybe this will work (or maybe not...): var products = new Array(); logic:iterate id=productBeans name=products indexId=i var productBeansbean:write name=i/ = new Array(); logic:iterate id=productBean name=productBeans indexId=j productBeansbean:write name=i/[bean:write name=j/] = [bean:write name=productBean property=productName/, bean:write name=productBean property=productId/]; /logic:iterate products[bean:write name=i/] = productBeansbean:write name=i/; /logic:iterate Quoting Rick Col [EMAIL PROTECTED]: Hi, I did the following, but the results were not displayed. Whats wrong with my code? products is a collection of ArrayLists, every arrayList contains a list of ProductBeans, ProductBean has productName and productId properties. products are retrieved in action class and are put into session scope: session.setAttribute(products, products); var productsArray = new Array(); logic:iterate id = aList name = products indexId = idx logic:iterate id = ProductBean name = aList indexId = index productsArray[%=idx%][%=index%] = new Array(bean:write name = ProductBean property = productName/, bean:write name = ProductBean property = productId/); /logic:iterate /logic:iterate Thanks in advance. rick --- Rick Col [EMAIL PROTECTED] wrote: More questions about the following: 1) It says in logic tags reference: id: The name of a page scope JSP bean that will contain the current element of the collection on each iteration, if it is not null. So, it means myList ArrayList should conform to JavaBean routines, is that right? For example: If I have a List4Js class, it has to have getters/seters for getting/setting ArrayLists: ArrayList myList = List4J.getResultList(); And the elements of an ArrayList should be a bean too. 2) If I want to get a collection of arraylists, I can use the logic:iterate tag as following: logic:iterate id=jsList name=listForJavaScript indexId=idx logic:iterate id=myBean name=jsList indexId=index jsArray[%=idx%][%=index%] = %=myBean.getYourValue()%; /logic:iterate /logic:iterate Since JavaScript Array usually has the following form: myArray = new Array(sample, 1); Do I need to conform to the above routine to create an JavaScript Array element in order to correctly display the results? regards, rick --- James Childers [EMAIL PROTECTED] wrote: You'll need to do a couple of things: 1) (Assuming you're using Struts, of course.) Create your Java array/collection/whatever in the Action that gets hit before your JSP page: List myList = new ArrayList(); // populate the list, la la la request.addAttribute(listForJavascript, myList); return mapping.findForward(success); // Takes you to, say, bongabonga.jsp 2) In bongabonga.jsp: head script type=text/javascript var jsArray = new Array(); // Do you have to init this? I don't remember. logic:iterate id=jsList name=listForJavaScript indexId=idx jsArray[%=idx%] = %=jsList.getYourValue()%; /logic:iterate /script 3) Debug. This is all from memory. I'm sure there are some glaring errors here, but this is the general flow. -= J -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: newbie question: Java array to JavaScript Array
Hahahahaha.Kris, yes this is sickening. More so after trying all possible solutions. This ruined my Friday :((. regards, Rick --- Kris Schneider [EMAIL PROTECTED] wrote: Man, this is really sick ;-). If I'm understanding you, maybe this will work (or maybe not...): var products = new Array(); logic:iterate id=productBeans name=products indexId=i var productBeansbean:write name=i/ = new Array(); logic:iterate id=productBean name=productBeans indexId=j productBeansbean:write name=i/[bean:write name=j/] = [bean:write name=productBean property=productName/, bean:write name=productBean property=productId/]; /logic:iterate products[bean:write name=i/] = productBeansbean:write name=i/; /logic:iterate Quoting Rick Col [EMAIL PROTECTED]: Hi, I did the following, but the results were not displayed. Whats wrong with my code? products is a collection of ArrayLists, every arrayList contains a list of ProductBeans, ProductBean has productName and productId properties. products are retrieved in action class and are put into session scope: session.setAttribute(products, products); var productsArray = new Array(); logic:iterate id = aList name = products indexId = idx logic:iterate id = ProductBean name = aList indexId = index productsArray[%=idx%][%=index%] = new Array(bean:write name = ProductBean property = productName/, bean:write name = ProductBean property = productId/); /logic:iterate /logic:iterate Thanks in advance. rick --- Rick Col [EMAIL PROTECTED] wrote: More questions about the following: 1) It says in logic tags reference: id: The name of a page scope JSP bean that will contain the current element of the collection on each iteration, if it is not null. So, it means myList ArrayList should conform to JavaBean routines, is that right? For example: If I have a List4Js class, it has to have getters/seters for getting/setting ArrayLists: ArrayList myList = List4J.getResultList(); And the elements of an ArrayList should be a bean too. 2) If I want to get a collection of arraylists, I can use the logic:iterate tag as following: logic:iterate id=jsList name=listForJavaScript indexId=idx logic:iterate id=myBean name=jsList indexId=index jsArray[%=idx%][%=index%] = %=myBean.getYourValue()%; /logic:iterate /logic:iterate Since JavaScript Array usually has the following form: myArray = new Array(sample, 1); Do I need to conform to the above routine to create an JavaScript Array element in order to correctly display the results? regards, rick --- James Childers [EMAIL PROTECTED] wrote: You'll need to do a couple of things: 1) (Assuming you're using Struts, of course.) Create your Java array/collection/whatever in the Action that gets hit before your JSP page: List myList = new ArrayList(); // populate the list, la la la request.addAttribute(listForJavascript, myList); return mapping.findForward(success); // Takes you to, say, bongabonga.jsp 2) In bongabonga.jsp: head script type=text/javascript var jsArray = new Array(); // Do you have to init this? I don't remember. logic:iterate id=jsList name=listForJavaScript indexId=idx jsArray[%=idx%] = %=jsList.getYourValue()%; /logic:iterate /script 3) Debug. This is all from memory. I'm sure there are some glaring errors here, but this is the general flow. -= J -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: newbie question: Java array to JavaScript Array
So it's still not working? Can you post some of the generated JavaScript? I was shooting for something like this: var products = new Array(); var productBeans0 = new Array(); productBeans0[0] = [name0, id0]; productBeans0[1] = [name1, id1]; ... products[0] = productBeans0; var productBeans1 = new Array(); productBeans1[0] = [name0, id0]; productBeans1[1] = [name1, id1]; ... products[1] = productBeans1; ... Rick Col wrote: Hahahahaha.Kris, yes this is sickening. More so after trying all possible solutions. This ruined my Friday :((. regards, Rick --- Kris Schneider [EMAIL PROTECTED] wrote: Man, this is really sick ;-). If I'm understanding you, maybe this will work (or maybe not...): var products = new Array(); logic:iterate id=productBeans name=products indexId=i var productBeansbean:write name=i/ = new Array(); logic:iterate id=productBean name=productBeans indexId=j productBeansbean:write name=i/[bean:write name=j/] = [bean:write name=productBean property=productName/, bean:write name=productBean property=productId/]; /logic:iterate products[bean:write name=i/] = productBeansbean:write name=i/; /logic:iterate Quoting Rick Col [EMAIL PROTECTED]: Hi, I did the following, but the results were not displayed. Whats wrong with my code? products is a collection of ArrayLists, every arrayList contains a list of ProductBeans, ProductBean has productName and productId properties. products are retrieved in action class and are put into session scope: session.setAttribute(products, products); var productsArray = new Array(); logic:iterate id = aList name = products indexId = idx logic:iterate id = ProductBean name = aList indexId = index productsArray[%=idx%][%=index%] = new Array(bean:write name = ProductBean property = productName/, bean:write name = ProductBean property = productId/); /logic:iterate /logic:iterate Thanks in advance. rick --- Rick Col [EMAIL PROTECTED] wrote: More questions about the following: 1) It says in logic tags reference: id: The name of a page scope JSP bean that will contain the current element of the collection on each iteration, if it is not null. So, it means myList ArrayList should conform to JavaBean routines, is that right? For example: If I have a List4Js class, it has to have getters/seters for getting/setting ArrayLists: ArrayList myList = List4J.getResultList(); And the elements of an ArrayList should be a bean too. 2) If I want to get a collection of arraylists, I can use the logic:iterate tag as following: logic:iterate id=jsList name=listForJavaScript indexId=idx logic:iterate id=myBean name=jsList indexId=index jsArray[%=idx%][%=index%] = %=myBean.getYourValue()%; /logic:iterate /logic:iterate Since JavaScript Array usually has the following form: myArray = new Array(sample, 1); Do I need to conform to the above routine to create an JavaScript Array element in order to correctly display the results? regards, rick --- James Childers [EMAIL PROTECTED] wrote: You'll need to do a couple of things: 1) (Assuming you're using Struts, of course.) Create your Java array/collection/whatever in the Action that gets hit before your JSP page: List myList = new ArrayList(); // populate the list, la la la request.addAttribute(listForJavascript, myList); return mapping.findForward(success); // Takes you to, say, bongabonga.jsp 2) In bongabonga.jsp: head script type=text/javascript var jsArray = new Array(); // Do you have to init this? I don't remember. logic:iterate id=jsList name=listForJavaScript indexId=idx jsArray[%=idx%] = %=jsList.getYourValue()%; /logic:iterate /script 3) Debug. This is all from memory. I'm sure there are some glaring errors here, but this is the general flow. -= J -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Newbie question about form variables.
session scope or hidden fields on each page. sandeep --- Norr, Peter [EMAIL PROTECTED] wrote: I am developing a wizard style form.. How do I obtain the value submitted in the previous page of a form from the jsp page? For example, in step2.jsp I need to know what was selected in step1.jsp. Thanks! Peter -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Newbie question about form variables.
I am developing a wizard style form.. How do I obtain the value submitted in the previous page of a form from the jsp page? For example, in step2.jsp I need to know what was selected in step1.jsp. Thanks! Peter -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie question about form variables.
one way is to have both pages share a formbean, the first page populates the formBean with what was entered so the second page can access it. -Original Message- From: Norr, Peter [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 2:35 PM To: 'Struts Users Mailing List' Subject: Newbie question about form variables. I am developing a wizard style form.. How do I obtain the value submitted in the previous page of a form from the jsp page? For example, in step2.jsp I need to know what was selected in step1.jsp. Thanks! Peter -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie question about form variables.
Yes I understand. But how do I acces the Form Bean from the jsp page? Peter -Original Message- From: Mike Jasnowski [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 2:40 PM To: Struts Users Mailing List Subject: RE: Newbie question about form variables. one way is to have both pages share a formbean, the first page populates the formBean with what was entered so the second page can access it. -Original Message- From: Norr, Peter [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 2:35 PM To: 'Struts Users Mailing List' Subject: Newbie question about form variables. I am developing a wizard style form.. How do I obtain the value submitted in the previous page of a form from the jsp page? For example, in step2.jsp I need to know what was selected in step1.jsp. Thanks! Peter -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie question about form variables.
scriptlets (bad choice) custom tags (flexible choice) jstl, accessing the implicit session (you did store the form in the session, didn't you...) and form key name From: Norr, Peter [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: RE: Newbie question about form variables. Date: Thu, 17 Jul 2003 15:02:11 -0400 Yes I understand. But how do I acces the Form Bean from the jsp page? Peter -Original Message- From: Mike Jasnowski [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 2:40 PM To: Struts Users Mailing List Subject: RE: Newbie question about form variables. one way is to have both pages share a formbean, the first page populates the formBean with what was entered so the second page can access it. -Original Message- From: Norr, Peter [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 2:35 PM To: 'Struts Users Mailing List' Subject: Newbie question about form variables. I am developing a wizard style form.. How do I obtain the value submitted in the previous page of a form from the jsp page? For example, in step2.jsp I need to know what was selected in step1.jsp. Thanks! Peter -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie question about form variables.
Does Struts 1.1 come with JSTL implementation? If so How do I use it? Peter -Original Message- From: Adam Levine [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 3:05 PM To: [EMAIL PROTECTED] Subject: RE: Newbie question about form variables. scriptlets (bad choice) custom tags (flexible choice) jstl, accessing the implicit session (you did store the form in the session, didn't you...) and form key name From: Norr, Peter [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: RE: Newbie question about form variables. Date: Thu, 17 Jul 2003 15:02:11 -0400 Yes I understand. But how do I acces the Form Bean from the jsp page? Peter -Original Message- From: Mike Jasnowski [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 2:40 PM To: Struts Users Mailing List Subject: RE: Newbie question about form variables. one way is to have both pages share a formbean, the first page populates the formBean with what was entered so the second page can access it. -Original Message- From: Norr, Peter [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 2:35 PM To: 'Struts Users Mailing List' Subject: Newbie question about form variables. I am developing a wizard style form.. How do I obtain the value submitted in the previous page of a form from the jsp page? For example, in step2.jsp I need to know what was selected in step1.jsp. Thanks! Peter -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice
RE: Newbie question about form variables.
You would use one of the Struts or JSTL or whatever JSP tag you want to access the FormBean. When a JSP is forwarded to from an Action, a formBean mapped to that action is stuffed into the session by the name you specified in your struts config. . So for example if your formbean had a property named state, with a getState() accessor: c:out value=${FormBean.state}/ Would write out the value of the state property Is this what you meant? -Original Message- From: Norr, Peter [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 3:02 PM To: 'Struts Users Mailing List' Subject: RE: Newbie question about form variables. Yes I understand. But how do I acces the Form Bean from the jsp page? Peter -Original Message- From: Mike Jasnowski [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 2:40 PM To: Struts Users Mailing List Subject: RE: Newbie question about form variables. one way is to have both pages share a formbean, the first page populates the formBean with what was entered so the second page can access it. -Original Message- From: Norr, Peter [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 2:35 PM To: 'Struts Users Mailing List' Subject: Newbie question about form variables. I am developing a wizard style form.. How do I obtain the value submitted in the previous page of a form from the jsp page? For example, in step2.jsp I need to know what was selected in step1.jsp. Thanks! Peter -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie question about form variables.
yes, 1.1 comes with some of the older struts tags revamped to use JSTL (look in the contrib dir). apache also has the jstl implementation for download. you use them like any other tags. just with JSTL syntax. From: Norr, Peter [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: RE: Newbie question about form variables. Date: Thu, 17 Jul 2003 15:12:33 -0400 Does Struts 1.1 come with JSTL implementation? If so How do I use it? Peter -Original Message- From: Adam Levine [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 3:05 PM To: [EMAIL PROTECTED] Subject: RE: Newbie question about form variables. scriptlets (bad choice) custom tags (flexible choice) jstl, accessing the implicit session (you did store the form in the session, didn't you...) and form key name From: Norr, Peter [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: RE: Newbie question about form variables. Date: Thu, 17 Jul 2003 15:02:11 -0400 Yes I understand. But how do I acces the Form Bean from the jsp page? Peter -Original Message- From: Mike Jasnowski [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 2:40 PM To: Struts Users Mailing List Subject: RE: Newbie question about form variables. one way is to have both pages share a formbean, the first page populates the formBean with what was entered so the second page can access it. -Original Message- From: Norr, Peter [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 2:35 PM To: 'Struts Users Mailing List' Subject: Newbie question about form variables. I am developing a wizard style form.. How do I obtain the value submitted in the previous page of a form from the jsp page? For example, in step2.jsp I need to know what was selected in step1.jsp. Thanks! Peter -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any
RE: Newbie question about form variables.
Yes! But I am using DynaActionForm. I would also like to query the value submitted from step1.jsp.. -Original Message- From: Mike Jasnowski [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 3:14 PM To: Struts Users Mailing List Subject: RE: Newbie question about form variables. You would use one of the Struts or JSTL or whatever JSP tag you want to access the FormBean. When a JSP is forwarded to from an Action, a formBean mapped to that action is stuffed into the session by the name you specified in your struts config. . So for example if your formbean had a property named state, with a getState() accessor: c:out value=${FormBean.state}/ Would write out the value of the state property Is this what you meant? -Original Message- From: Norr, Peter [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 3:02 PM To: 'Struts Users Mailing List' Subject: RE: Newbie question about form variables. Yes I understand. But how do I acces the Form Bean from the jsp page? Peter -Original Message- From: Mike Jasnowski [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 2:40 PM To: Struts Users Mailing List Subject: RE: Newbie question about form variables. one way is to have both pages share a formbean, the first page populates the formBean with what was entered so the second page can access it. -Original Message- From: Norr, Peter [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 2:35 PM To: 'Struts Users Mailing List' Subject: Newbie question about form variables. I am developing a wizard style form.. How do I obtain the value submitted in the previous page of a form from the jsp page? For example, in step2.jsp I need to know what was selected in step1.jsp. Thanks! Peter -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All
RE: Newbie question about form variables.
It doesn't matter, a DynaActionForm has a name just like other action forms. -Original Message- From: Norr, Peter [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 3:18 PM To: 'Struts Users Mailing List' Subject: RE: Newbie question about form variables. Yes! But I am using DynaActionForm. I would also like to query the value submitted from step1.jsp.. -Original Message- From: Mike Jasnowski [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 3:14 PM To: Struts Users Mailing List Subject: RE: Newbie question about form variables. You would use one of the Struts or JSTL or whatever JSP tag you want to access the FormBean. When a JSP is forwarded to from an Action, a formBean mapped to that action is stuffed into the session by the name you specified in your struts config. . So for example if your formbean had a property named state, with a getState() accessor: c:out value=${FormBean.state}/ Would write out the value of the state property Is this what you meant? -Original Message- From: Norr, Peter [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 3:02 PM To: 'Struts Users Mailing List' Subject: RE: Newbie question about form variables. Yes I understand. But how do I acces the Form Bean from the jsp page? Peter -Original Message- From: Mike Jasnowski [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 2:40 PM To: Struts Users Mailing List Subject: RE: Newbie question about form variables. one way is to have both pages share a formbean, the first page populates the formBean with what was entered so the second page can access it. -Original Message- From: Norr, Peter [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 2:35 PM To: 'Struts Users Mailing List' Subject: Newbie question about form variables. I am developing a wizard style form.. How do I obtain the value submitted in the previous page of a form from the jsp page? For example, in step2.jsp I need to know what was selected in step1.jsp. Thanks! Peter -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any
RE: Newbie question about form variables.
In answer to your second query If the actions that forward to step1.jsp and step2.jsp both share the same formBean. Step1 submits a form which populates your formbean, step2 is then forwarded to, and since that action shares the sameFormBean, step2 can access it's contents. It's just sharing a JavaBean, and saving you the work of instantiating it and putting it in the session under a specific name, as well as populating it from a form. HTH, Mike Jasnowski -Original Message- From: Mike Jasnowski [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 3:20 PM To: Struts Users Mailing List Subject: RE: Newbie question about form variables. It doesn't matter, a DynaActionForm has a name just like other action forms. -Original Message- From: Norr, Peter [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 3:18 PM To: 'Struts Users Mailing List' Subject: RE: Newbie question about form variables. Yes! But I am using DynaActionForm. I would also like to query the value submitted from step1.jsp.. -Original Message- From: Mike Jasnowski [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 3:14 PM To: Struts Users Mailing List Subject: RE: Newbie question about form variables. You would use one of the Struts or JSTL or whatever JSP tag you want to access the FormBean. When a JSP is forwarded to from an Action, a formBean mapped to that action is stuffed into the session by the name you specified in your struts config. . So for example if your formbean had a property named state, with a getState() accessor: c:out value=${FormBean.state}/ Would write out the value of the state property Is this what you meant? -Original Message- From: Norr, Peter [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 3:02 PM To: 'Struts Users Mailing List' Subject: RE: Newbie question about form variables. Yes I understand. But how do I acces the Form Bean from the jsp page? Peter -Original Message- From: Mike Jasnowski [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 2:40 PM To: Struts Users Mailing List Subject: RE: Newbie question about form variables. one way is to have both pages share a formbean, the first page populates the formBean with what was entered so the second page can access it. -Original Message- From: Norr, Peter [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 2:35 PM To: 'Struts Users Mailing List' Subject: Newbie question about form variables. I am developing a wizard style form.. How do I obtain the value submitted in the previous page of a form from the jsp page? For example, in step2.jsp I need to know what was selected in step1.jsp. Thanks! Peter -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
RE: Newbie question about form variables.
If my form bean is DynaActionForm.. How do I do something like this... c:if test=${formBean.get('someProperty')=='PETER'} /c:if -Original Message- From: Mike Jasnowski [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 3:28 PM To: Struts Users Mailing List Subject: RE: Newbie question about form variables. In answer to your second query If the actions that forward to step1.jsp and step2.jsp both share the same formBean. Step1 submits a form which populates your formbean, step2 is then forwarded to, and since that action shares the sameFormBean, step2 can access it's contents. It's just sharing a JavaBean, and saving you the work of instantiating it and putting it in the session under a specific name, as well as populating it from a form. HTH, Mike Jasnowski -Original Message- From: Mike Jasnowski [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 3:20 PM To: Struts Users Mailing List Subject: RE: Newbie question about form variables. It doesn't matter, a DynaActionForm has a name just like other action forms. -Original Message- From: Norr, Peter [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 3:18 PM To: 'Struts Users Mailing List' Subject: RE: Newbie question about form variables. Yes! But I am using DynaActionForm. I would also like to query the value submitted from step1.jsp.. -Original Message- From: Mike Jasnowski [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 3:14 PM To: Struts Users Mailing List Subject: RE: Newbie question about form variables. You would use one of the Struts or JSTL or whatever JSP tag you want to access the FormBean. When a JSP is forwarded to from an Action, a formBean mapped to that action is stuffed into the session by the name you specified in your struts config. . So for example if your formbean had a property named state, with a getState() accessor: c:out value=${FormBean.state}/ Would write out the value of the state property Is this what you meant? -Original Message- From: Norr, Peter [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 3:02 PM To: 'Struts Users Mailing List' Subject: RE: Newbie question about form variables. Yes I understand. But how do I acces the Form Bean from the jsp page? Peter -Original Message- From: Mike Jasnowski [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 2:40 PM To: Struts Users Mailing List Subject: RE: Newbie question about form variables. one way is to have both pages share a formbean, the first page populates the formBean with what was entered so the second page can access it. -Original Message- From: Norr, Peter [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 2:35 PM To: 'Struts Users Mailing List' Subject: Newbie question about form variables. I am developing a wizard style form.. How do I obtain the value submitted in the previous page of a form from the jsp page? For example, in step2.jsp I need to know what was selected in step1.jsp. Thanks! Peter -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate
Re: newbie question - setting form parameter in Javascript
probably you can not see the javascript error, because the form submits in the function, remove the submit(); in the function and see the error, and also I recommend you not to use onclick event, try onchange, it's better in this situation. F. - Original Message - From: Shyam A [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, July 11, 2003 9:15 PM Subject: newbie question - setting form parameter in Javascript Hi, I have an HTML form with Submit and Cancel buttons, and a drop down list, which when clicked submits the form. I use Javascript to submit the form when the dropdown list is clicked. I have a property called action defined in my ActionForm class that identifies the Submit and Cancel buttons in the HTML form. When the drop-down is clicked, I would like to set the value of this action property to Lookup. My Javascript function is given below: SCRIPT language=JavaScript function submitForm(form) { form.action.value=Lookup; form.submit(); return true; } # and I invoke this function in my HTML form as shown below: # html:select property=crn onclick=submitForm(this.form) html:option value=Test selectedTest/html:option /html:select ### But, the value of the property action is not set to Lookup. Any help would be greatly appreciated. Thanks, Shyam - Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: newbie question - setting form parameter in Javascript
My Javascript function is given below: SCRIPT language=JavaScript function submitForm(form) { form.action.value=Lookup; form.submit(); return true; } # and I invoke this function in my HTML form as shown below: # html:select property=crn onclick=submitForm(this.form) html:option value=Test selectedTest/html:option /html:select ### But, the value of the property action is not set to Lookup. Any help would be greatly appreciated. probably an obvious question, but are you sure you have a hidden form field called action on this page so that your javascript function can set it? -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: newbie question - setting form parameter in Javascript
Mark, Thanks a lot for your mails. I have used action as a form bean property and not as a parameter in struts-config. Unfortunately, the Javascript function doesn't seem to work...it does not set the value of the ActionForm property, action. When I tried to print out the value of the action property in my ActionClass, I got a null value. I tried the following code in my Action class and I got a null value. String action = ((ActionForm) form).getAction(); Wonder if I have missed something. Shyam Mark Lowe [EMAIL PROTECTED] wrote: Its better that this is posted to the list as well, after all its a good question and hopefully an adequate answer. function lookup(form) { form.elements['action'].value = lookup; form.submit(); } //-- ... [input] //struts config name=myForm redirect=false parameter=action / The only thing you'd have to watch would be if the client didn't support javascript then you'd lose lookup, this would make a case for having action as a form bean property and have some relevantly named form elements in noscript tags. If lookup isn't mission critical then i guess you could let this slide. On Friday, July 11, 2003, at 08:44 PM, Shyam A wrote: Mark, Thanks for your mail. I understand that DispatchAction class includes multiple execute methods for different actions. However, I still have some doubts. You mentioned using tags in JSP: Are these used instead of using Submit buttons ? i.e use and in conjunction instead of ? Can be used for a drop- down? I guess my problem is still unresolved. As I mentioned in my earlier mail, I have a drop-down associated with an ActionForm property crn . None I would like to trigger an action called Lookup when the drop-down is clicked .i.e, associate the clicking of the drop-down with the action property of the ActionForm class. I don't know how to set the action property of the ActionForm class when the drop-down is selected, based on which appropriate method of the DispatchAction class would be executed. Any help would be greatly appreciated. Thanks, Shyam Mark Lowe wrote: check out dispatch actions.. you can have multiple execute methods with dispatch action ... Your Action class extends DispatchAction instead of action (check the docs) public final ActionForward submit( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ... } public final ActionForward lookup( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ... } in struts config the parameter attibute need to know the name of the parameter your about to send, the value of which is your execute method name.. scope=request parameter=action ... and then in jsp HTH Mark On Friday, July 11, 2003, at 08:00 PM, Shyam A wrote: James, Thanks for your mail. I guess I need to elaborate a little bit. My HTML form can be submitted in 2ways. 1. Clicking the Submit button. 2. Clicking the drop-down Clicking the drop-down triggers a different action than clicking the Submit button. Selecting a value in the drop-down would submit the form and populate some of the other fields in the form. This is done before the Submit button is clicked. So, I need to distinguish the action of clicking the drop-down from clicking the Submit button and I called it Lookup. Both actions would be identified with a single property in the ActionForm class - action. eg: I would like to set this action property value to Lookup on clicking the drop-down using Javascript. I guess a hidden field would not serve the purpose as I already have action property defined for the Submit button. Look forward to your help/suggestions. Thanks, Shyam James Mitchell wrote: You will need to create a hidden field named action, with a value of Lookup: My question to you iswhy Lookup? What does that have to do with your form? Here's a sample: function submitForm(form) { form.action.value=Lookup; form.submit(); return true; } [input] Test Test2 On Friday 11 July 2003 14:15, Shyam A wrote: Hi, I have an HTML form with Submit and Cancel buttons, and a drop down list, which when clicked submits the form. I use Javascript to submit the form when the dropdown list is clicked. I have a property called action defined in my ActionForm class that identifies the Submit and Cancel buttons in the HTML form. When the drop-down is clicked, I would like to set the value of this action property to Lookup. My Javascript function is given below: function submitForm(form) { form.action.value=Lookup; form.submit(); return true; } # and I
newbie question - setting form parameter in Javascript
Hi, I have an HTML form with Submit and Cancel buttons, and a drop down list, which when clicked submits the form. I use Javascript to submit the form when the dropdown list is clicked. I have a property called action defined in my ActionForm class that identifies the Submit and Cancel buttons in the HTML form. When the drop-down is clicked, I would like to set the value of this action property to Lookup. My Javascript function is given below: SCRIPT language=JavaScript function submitForm(form) { form.action.value=Lookup; form.submit(); return true; } # and I invoke this function in my HTML form as shown below: # html:select property=crn onclick=submitForm(this.form) html:option value=Test selectedTest/html:option /html:select ### But, the value of the property action is not set to Lookup. Any help would be greatly appreciated. Thanks, Shyam - Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month!
Re: newbie question - setting form parameter in Javascript
You will need to create a hidden field named action, with a value of Lookup: html:hidden property=action value=Lookup/ My question to you iswhy Lookup? What does that have to do with your form? Here's a sample: SCRIPT language=JavaScript function submitForm(form) { form.action.value=Lookup; form.submit(); return true; } /SCRIPT form name=frm action=? method=GET input type=hidden name=action value= select name=crn onclick=submitForm(this.form) option value=Test selectedTest/option option value=Test2Test2/option /select /form On Friday 11 July 2003 14:15, Shyam A wrote: Hi, I have an HTML form with Submit and Cancel buttons, and a drop down list, which when clicked submits the form. I use Javascript to submit the form when the dropdown list is clicked. I have a property called action defined in my ActionForm class that identifies the Submit and Cancel buttons in the HTML form. When the drop-down is clicked, I would like to set the value of this action property to Lookup. My Javascript function is given below: SCRIPT language=JavaScript function submitForm(form) { form.action.value=Lookup; form.submit(); return true; } # and I invoke this function in my HTML form as shown below: # html:select property=crn onclick=submitForm(this.form) html:option value=Test selectedTest/html:option /html:select ### But, the value of the property action is not set to Lookup. Any help would be greatly appreciated. Thanks, Shyam - Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! -- James Mitchell Software Developer/Struts Evangelist http://www.struts-atlanta.org 678-910-8017 AIM:jmitchtx - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: newbie question - setting form parameter in Javascript
James, Thanks for your mail. I guess I need to elaborate a little bit. My HTML form can be submitted in 2ways. 1. Clicking the Submit button. 2. Clicking the drop-down Clicking the drop-down triggers a different action than clicking the Submit button. Selecting a value in the drop-down would submit the form and populate some of the other fields in the form. This is done before the Submit button is clicked. So, I need to distinguish the action of clicking the drop-down from clicking the Submit button and I called it Lookup. Both actions would be identified with a single property in the ActionForm class - action. eg: html:submit property=action value=Submit/ I would like to set this action property value to Lookup on clicking the drop-down using Javascript. I guess a hidden field would not serve the purpose as I already have action property defined for the Submit button. Look forward to your help/suggestions. Thanks, Shyam James Mitchell [EMAIL PROTECTED] wrote: You will need to create a hidden field named action, with a value of Lookup: My question to you iswhy Lookup? What does that have to do with your form? Here's a sample: function submitForm(form) { form.action.value=Lookup; form.submit(); return true; } [input] Test Test2 On Friday 11 July 2003 14:15, Shyam A wrote: Hi, I have an HTML form with Submit and Cancel buttons, and a drop down list, which when clicked submits the form. I use Javascript to submit the form when the dropdown list is clicked. I have a property called action defined in my ActionForm class that identifies the Submit and Cancel buttons in the HTML form. When the drop-down is clicked, I would like to set the value of this action property to Lookup. My Javascript function is given below: function submitForm(form) { form.action.value=Lookup; form.submit(); return true; } # and I invoke this function in my HTML form as shown below: # Test ### But, the value of the property action is not set to Lookup. Any help would be greatly appreciated. Thanks, Shyam - Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! -- James Mitchell Software Developer/Struts Evangelist http://www.struts-atlanta.org 678-910-8017 AIM:jmitchtx - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month!
Re: newbie question - setting form parameter in Javascript
check out dispatch actions.. you can have multiple execute methods with dispatch action ... Your Action class extends DispatchAction instead of action (check the docs) public final ActionForward submit( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ... } public final ActionForward lookup( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ... } in struts config the parameter attibute need to know the name of the parameter your about to send, the value of which is your execute method name.. action path=/processForm type=com.sparrow.struts.MyAction scope=request parameter=action ... and then in jsp html:link page=/processForm.do?action=lookup html:link page=/processForm.do?action=submit HTH Mark On Friday, July 11, 2003, at 08:00 PM, Shyam A wrote: James, Thanks for your mail. I guess I need to elaborate a little bit. My HTML form can be submitted in 2ways. 1. Clicking the Submit button. 2. Clicking the drop-down Clicking the drop-down triggers a different action than clicking the Submit button. Selecting a value in the drop-down would submit the form and populate some of the other fields in the form. This is done before the Submit button is clicked. So, I need to distinguish the action of clicking the drop-down from clicking the Submit button and I called it Lookup. Both actions would be identified with a single property in the ActionForm class - action. eg: html:submit property=action value=Submit/ I would like to set this action property value to Lookup on clicking the drop-down using Javascript. I guess a hidden field would not serve the purpose as I already have action property defined for the Submit button. Look forward to your help/suggestions. Thanks, Shyam James Mitchell [EMAIL PROTECTED] wrote: You will need to create a hidden field named action, with a value of Lookup: My question to you iswhy Lookup? What does that have to do with your form? Here's a sample: function submitForm(form) { form.action.value=Lookup; form.submit(); return true; } [input] Test Test2 On Friday 11 July 2003 14:15, Shyam A wrote: Hi, I have an HTML form with Submit and Cancel buttons, and a drop down list, which when clicked submits the form. I use Javascript to submit the form when the dropdown list is clicked. I have a property called action defined in my ActionForm class that identifies the Submit and Cancel buttons in the HTML form. When the drop-down is clicked, I would like to set the value of this action property to Lookup. My Javascript function is given below: function submitForm(form) { form.action.value=Lookup; form.submit(); return true; } # and I invoke this function in my HTML form as shown below: # Test ### But, the value of the property action is not set to Lookup. Any help would be greatly appreciated. Thanks, Shyam - Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! -- James Mitchell Software Developer/Struts Evangelist http://www.struts-atlanta.org 678-910-8017 AIM:jmitchtx - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: newbie question - setting form parameter in Javascript
I think I see where you are goingtry setting the form action instead: SCRIPT language=JavaScript function submitForm(form) { document.frm.action=lookup.do; // --Change this to not be hard-coded form.submit(); return true; } /SCRIPT form name=frm action=? method=GET input type=hidden name=action value= select name=crn onclick=submitForm(this.form) option value=Test selectedTest/option option value=Test2Test2/option /select br input type=submit name=action value=Submit /form On Friday 11 July 2003 15:00, Shyam A wrote: James, Thanks for your mail. I guess I need to elaborate a little bit. My HTML form can be submitted in 2ways. 1. Clicking the Submit button. 2. Clicking the drop-down Clicking the drop-down triggers a different action than clicking the Submit button. Selecting a value in the drop-down would submit the form and populate some of the other fields in the form. This is done before the Submit button is clicked. So, I need to distinguish the action of clicking the drop-down from clicking the Submit button and I called it Lookup. Both actions would be identified with a single property in the ActionForm class - action. eg: html:submit property=action value=Submit/ I would like to set this action property value to Lookup on clicking the drop-down using Javascript. I guess a hidden field would not serve the purpose as I already have action property defined for the Submit button. Look forward to your help/suggestions. Thanks, Shyam James Mitchell [EMAIL PROTECTED] wrote: You will need to create a hidden field named action, with a value of Lookup: My question to you iswhy Lookup? What does that have to do with your form? Here's a sample: function submitForm(form) { form.action.value=Lookup; form.submit(); return true; } [input] Test Test2 On Friday 11 July 2003 14:15, Shyam A wrote: Hi, I have an HTML form with Submit and Cancel buttons, and a drop down list, which when clicked submits the form. I use Javascript to submit the form when the dropdown list is clicked. I have a property called action defined in my ActionForm class that identifies the Submit and Cancel buttons in the HTML form. When the drop-down is clicked, I would like to set the value of this action property to Lookup. My Javascript function is given below: function submitForm(form) { form.action.value=Lookup; form.submit(); return true; } # and I invoke this function in my HTML form as shown below: # Test ### But, the value of the property action is not set to Lookup. Any help would be greatly appreciated. Thanks, Shyam - Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! -- James Mitchell Software Developer/Struts Evangelist http://www.struts-atlanta.org 678-910-8017 AIM:jmitchtx - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: newbie question - setting form parameter in Javascript
Its better that this is posted to the list as well, after all its a good question and hopefully an adequate answer. script language=javascript type=text/javascript !-- function lookup(form) { form.elements['action'].value = lookup; form.submit(); } //-- /script html:form action=/process.do html:select onchange=lookup(this.form) ... /html:select input type=hidden name=action value=submit html:submit / /html:form //struts config action page=/process.do type=com.sparrow.struts.MyAction name=myForm redirect=false parameter=action / The only thing you'd have to watch would be if the client didn't support javascript then you'd lose lookup, this would make a case for having action as a form bean property and have some relevantly named form elements in noscript tags. If lookup isn't mission critical then i guess you could let this slide. On Friday, July 11, 2003, at 08:44 PM, Shyam A wrote: Mark, Thanks for your mail. I understand that DispatchAction class includes multiple execute methods for different actions. However, I still have some doubts. You mentioned using html:link tags in JSP: html:link page=/processForm.do?action=lookup html:link page=/processForm.do?action=submit Are these used instead of using Submit buttons ? i.e use html:button and html: link in conjunction instead of html:submit property=action value=Submit/ ? Can html:link be used for a drop- down? I guess my problem is still unresolved. As I mentioned in my earlier mail, I have a drop-down associated with an ActionForm property crn . html:select property=crn html:option value=None selectedNone/html:option /html:select I would like to trigger an action called Lookup when the drop-down is clicked .i.e, associate the clicking of the drop-down with the action property of the ActionForm class. I don't know how to set the action property of the ActionForm class when the drop-down is selected, based on which appropriate method of the DispatchAction class would be executed. Any help would be greatly appreciated. Thanks, Shyam Mark Lowe [EMAIL PROTECTED] wrote: check out dispatch actions.. you can have multiple execute methods with dispatch action ... Your Action class extends DispatchAction instead of action (check the docs) public final ActionForward submit( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ... } public final ActionForward lookup( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ... } in struts config the parameter attibute need to know the name of the parameter your about to send, the value of which is your execute method name.. scope=request parameter=action ... and then in jsp HTH Mark On Friday, July 11, 2003, at 08:00 PM, Shyam A wrote: James, Thanks for your mail. I guess I need to elaborate a little bit. My HTML form can be submitted in 2ways. 1. Clicking the Submit button. 2. Clicking the drop-down Clicking the drop-down triggers a different action than clicking the Submit button. Selecting a value in the drop-down would submit the form and populate some of the other fields in the form. This is done before the Submit button is clicked. So, I need to distinguish the action of clicking the drop-down from clicking the Submit button and I called it Lookup. Both actions would be identified with a single property in the ActionForm class - action. eg: I would like to set this action property value to Lookup on clicking the drop-down using Javascript. I guess a hidden field would not serve the purpose as I already have action property defined for the Submit button. Look forward to your help/suggestions. Thanks, Shyam James Mitchell wrote: You will need to create a hidden field named action, with a value of Lookup: My question to you iswhy Lookup? What does that have to do with your form? Here's a sample: function submitForm(form) { form.action.value=Lookup; form.submit(); return true; } [input] Test Test2 On Friday 11 July 2003 14:15, Shyam A wrote: Hi, I have an HTML form with Submit and Cancel buttons, and a drop down list, which when clicked submits the form. I use Javascript to submit the form when the dropdown list is clicked. I have a property called action defined in my ActionForm class that identifies the Submit and Cancel buttons in the HTML form. When the drop-down is clicked, I would like to set the value of this action property to Lookup. My Javascript function is given below: function submitForm(form) { form.action.value=Lookup; form.submit(); return true; } # and I invoke this function in my HTML form as shown below: # Test ### But, the value of the property action is not set to Lookup. Any help would be
Re: newbie question - setting form parameter in Javascript
opps my action in struts config is wrong... But you should still have the right idea.. On Saturday, July 12, 2003, at 12:45 AM, Mark Lowe wrote: Its better that this is posted to the list as well, after all its a good question and hopefully an adequate answer. script language=javascript type=text/javascript !-- function lookup(form) { form.elements['action'].value = lookup; form.submit(); } //-- /script html:form action=/process.do html:select onchange=lookup(this.form) ... /html:select input type=hidden name=action value=submit html:submit / /html:form //struts config action page=/process.do type=com.sparrow.struts.MyAction name=myForm redirect=false parameter=action / The only thing you'd have to watch would be if the client didn't support javascript then you'd lose lookup, this would make a case for having action as a form bean property and have some relevantly named form elements in noscript tags. If lookup isn't mission critical then i guess you could let this slide. On Friday, July 11, 2003, at 08:44 PM, Shyam A wrote: Mark, Thanks for your mail. I understand that DispatchAction class includes multiple execute methods for different actions. However, I still have some doubts. You mentioned using html:link tags in JSP: html:link page=/processForm.do?action=lookup html:link page=/processForm.do?action=submit Are these used instead of using Submit buttons ? i.e use html:button and html: link in conjunction instead of html:submit property=action value=Submit/ ? Can html:link be used for a drop- down? I guess my problem is still unresolved. As I mentioned in my earlier mail, I have a drop-down associated with an ActionForm property crn . html:select property=crn html:option value=None selectedNone/html:option /html:select I would like to trigger an action called Lookup when the drop-down is clicked .i.e, associate the clicking of the drop-down with the action property of the ActionForm class. I don't know how to set the action property of the ActionForm class when the drop-down is selected, based on which appropriate method of the DispatchAction class would be executed. Any help would be greatly appreciated. Thanks, Shyam Mark Lowe [EMAIL PROTECTED] wrote: check out dispatch actions.. you can have multiple execute methods with dispatch action ... Your Action class extends DispatchAction instead of action (check the docs) public final ActionForward submit( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ... } public final ActionForward lookup( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ... } in struts config the parameter attibute need to know the name of the parameter your about to send, the value of which is your execute method name.. scope=request parameter=action ... and then in jsp HTH Mark On Friday, July 11, 2003, at 08:00 PM, Shyam A wrote: James, Thanks for your mail. I guess I need to elaborate a little bit. My HTML form can be submitted in 2ways. 1. Clicking the Submit button. 2. Clicking the drop-down Clicking the drop-down triggers a different action than clicking the Submit button. Selecting a value in the drop-down would submit the form and populate some of the other fields in the form. This is done before the Submit button is clicked. So, I need to distinguish the action of clicking the drop-down from clicking the Submit button and I called it Lookup. Both actions would be identified with a single property in the ActionForm class - action. eg: I would like to set this action property value to Lookup on clicking the drop-down using Javascript. I guess a hidden field would not serve the purpose as I already have action property defined for the Submit button. Look forward to your help/suggestions. Thanks, Shyam James Mitchell wrote: You will need to create a hidden field named action, with a value of Lookup: My question to you iswhy Lookup? What does that have to do with your form? Here's a sample: function submitForm(form) { form.action.value=Lookup; form.submit(); return true; } [input] Test Test2 On Friday 11 July 2003 14:15, Shyam A wrote: Hi, I have an HTML form with Submit and Cancel buttons, and a drop down list, which when clicked submits the form. I use Javascript to submit the form when the dropdown list is clicked. I have a property called action defined in my ActionForm class that identifies the Submit and Cancel buttons in the HTML form. When the drop-down is clicked, I would like to set the value of this action property to Lookup. My Javascript function is given below: function submitForm(form) { form.action.value=Lookup; form.submit(); return true; } # and I invoke this function in my HTML form as shown
Newbie question: DispatchAction subclassing
Hi, I am currently developing a webapp with Struts 1.1 and I have decided to use the DispatchAction to group functionality, instead of having a large bunch of single Action classes. Now I face the following problem: I want to have some pre-processing generic code invoked for every action, but I'd rather have it in, say, a GenericDispatchAction than duplicate it in the subclasses. As I see, each of my subclasses would have its methodName executed against requests (instead of the traditional execute() method of the Action class). Where should I put this generic invocations (for example, for session, login checking, exception handling, authorization, etc.)? Could I override the DispatchAction execute() method in my GenericDispatchAction for example to do exception handling? Could I do common processing in the dispatchMethod() method instead? Please help! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: what setters do i implement in an indexed tag --NewBie question
Sashi, your person bean must have getName(), setName() and getPhoneNo(), setPhoneNo(). Everybody: I haven't come across the html:taglib indexed property before. This seems to do what nested: tags do - is this functional overlap? Generally with JST taglib as well, there seems to be a wide choice of taglibs to use - is this going to consolidate at some point in struts' development? Adam Sashi Ravipati wrote: Can some body help in as how to define get and set methods when we use indexed tags. eg: logic:iterate id=person name=myFormBean property=personList tr td bean:write name=person property=name/ html:hidden name=person property=name indexed=true/ /td td html:text name=person property=phoneNo indexed=true/ /td /tr /logic:iterate What will be the get and set methods. Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Newbie Question: Multiple User Input Screen
Sorry, if this question has been posted before (I just joined the group) Is there anyway to browse thru all the group messages on the web? I am trying to implement multiple input pages where the user will enter input data from one page to the next by using the next button. How do I capture all input on these 3 pages at the end when user hit submit button. By using session bean? link to any code examples greatly appreciated! Any thoughts? ___ No banners. No pop-ups. No kidding. Introducing My Way - http://www.myway.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie Question: Multiple User Input Screen
Yes, if you go to the Struts pages on Jakarta there is an archive. This particular topic has been discussed several times over :) http://nagoya.apache.org/eyebrowse/SummarizeList?listId=42 -Original Message- From: Tuan T [mailto:[EMAIL PROTECTED] Sent: Thursday, June 12, 2003 11:14 AM To: [EMAIL PROTECTED] Subject: Newbie Question: Multiple User Input Screen Sorry, if this question has been posted before (I just joined the group) Is there anyway to browse thru all the group messages on the web? I am trying to implement multiple input pages where the user will enter input data from one page to the next by using the next button. How do I capture all input on these 3 pages at the end when user hit submit button. By using session bean? link to any code examples greatly appreciated! Any thoughts? ___ No banners. No pop-ups. No kidding. Introducing My Way - http://www.myway.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie Question: Multiple User Input Screen
Hint: Search for Wizard -Original Message- From: Mike Jasnowski [mailto:[EMAIL PROTECTED] Sent: Thursday, June 12, 2003 11:20 AM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: Newbie Question: Multiple User Input Screen Yes, if you go to the Struts pages on Jakarta there is an archive. This particular topic has been discussed several times over :) http://nagoya.apache.org/eyebrowse/SummarizeList?listId=42 -Original Message- From: Tuan T [mailto:[EMAIL PROTECTED] Sent: Thursday, June 12, 2003 11:14 AM To: [EMAIL PROTECTED] Subject: Newbie Question: Multiple User Input Screen Sorry, if this question has been posted before (I just joined the group) Is there anyway to browse thru all the group messages on the web? I am trying to implement multiple input pages where the user will enter input data from one page to the next by using the next button. How do I capture all input on these 3 pages at the end when user hit submit button. By using session bean? link to any code examples greatly appreciated! Any thoughts? ___ No banners. No pop-ups. No kidding. Introducing My Way - http://www.myway.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: what setters do i implement in an indexed tag --NewBie question
I believe indexed attributes were first, then Arron contributed nested and life got easier. Stick with it and don't go backwards. -john -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 11, 2003 11:52 PM To: Struts Users Mailing List Subject: Re: what setters do i implement in an indexed tag --NewBie question Sashi, your person bean must have getName(), setName() and getPhoneNo(), setPhoneNo(). Everybody: I haven't come across the html:taglib indexed property before. This seems to do what nested: tags do - is this functional overlap? Generally with JST taglib as well, there seems to be a wide choice of taglibs to use - is this going to consolidate at some point in struts' development? Adam Sashi Ravipati wrote: Can some body help in as how to define get and set methods when we use indexed tags. eg: logic:iterate id=person name=myFormBean property=personList tr td bean:write name=person property=name/ html:hidden name=person property=name indexed=true/ /td td html:text name=person property=phoneNo indexed=true/ /td /tr /logic:iterate What will be the get and set methods. Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: what setters do i implement in an indexed tag--NewBie question
John Made few changes and code worked fine. Would like to extend this so that it will work for handling Dynamic table situation-- Let me explain If u see in Action form reset method I initialized it to 5 (num=5 for testing) so the page loads with five empty rows, But we have a requirement where the user can add more rows to the table and click submit. 1. Action form code: private ArrayList personList; public void reset(ActionMapping mapping, HttpServletRequest request){ this.personList = new ArrayList(); // String num = request.getParameter(personListLength); String num =5; try { if (num != null) { int len = Integer.parseInt(num); for (int i = 0; i len; i++) this.personList.add(new PersonBean()); } }catch (NumberFormatException e) { e.printStackTrace(); } } public PersonBean getPerson(int ndx) { return (PersonBean) personList.get(ndx); } public void setPersonList(int ndx, PersonBean p) { personList.set(ndx, p); } public ArrayList getPersonList(){ return this.personList; } 2. jsp TABLE id=mytable logic:present name=personList logic:iterate id=person name=dynaTableForm property=personList type=com.learning.struts.PersonBean tr td html:text name=person property=firstName indexed=true/ /td td html:text name=person property=phoneNo indexed=true/ /td /tr /logic:iterate /logic:present /TABLE 3.PersonBean: public class PersonBean implements Serializable { String firstName; String phoneNo; public PersonBean() { super(); } public String getFirstName() { return firstName; } public void setFirstName(String newFirstName) { firstName = newFirstName; } public String getPhoneNo() { return phoneNo; } public void setPhoneNo(String newPhoneNo) { phoneNo = newPhoneNo; } } Let me know if u need any further info. Thanks [EMAIL PROTECTED] 06/12/03 01:57PM I believe indexed attributes were first, then Arron contributed nested and life got easier. Stick with it and don't go backwards. -john -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 11, 2003 11:52 PM To: Struts Users Mailing List Subject: Re: what setters do i implement in an indexed tag --NewBie question Sashi, your person bean must have getName(), setName() and getPhoneNo(), setPhoneNo(). Everybody: I haven't come across the html:taglib indexed property before. This seems to do what nested: tags do - is this functional overlap? Generally with JST taglib as well, there seems to be a wide choice of taglibs to use - is this going to consolidate at some point in struts' development? Adam Sashi Ravipati wrote: Can some body help in as how to define get and set methods when we use indexed tags. eg: logic:iterate id=person name=myFormBean property=personList tr td bean:write name=person property=name/ html:hidden name=person property=name indexed=true/ /td td html:text name=person property=phoneNo indexed=true/ /td /tr /logic:iterate What will be the get and set methods. Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Newbie Question: Tiles and html:link how to make it work.
I am new to Struts and Tiles and am trying to make it work. I have written a simple web site that uses the html:link forward=some forward name ... and this works well. The some forward name is currently defined in the global forwards section of the struts-config.xml I have looked at the documentation on line and it is a little shy on this. I also have Ted Husted's book which is really great but I am still having a problem. Can anyone get me some guidance here? Thanks Glenn Davidson
RE: Newbie Question: Tiles and html:link how to make it work.
Your forward path can be a Tiles Def in the struts-config. You don't want to ever link directly to a Def (or JSP) so it sounds like you are fine. Need more detail otherwise. -Original Message- From: Davidson, Glenn [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 2:22 PM To: 'Struts Users Mailing List' Subject: Newbie Question: Tiles and html:link how to make it work. I am new to Struts and Tiles and am trying to make it work. I have written a simple web site that uses the html:link forward=some forward name ... and this works well. The some forward name is currently defined in the global forwards section of the struts-config.xml I have looked at the documentation on line and it is a little shy on this. I also have Ted Husted's book which is really great but I am still having a problem. Can anyone get me some guidance here? Thanks Glenn Davidson - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie Question: Tiles and html:link how to make it work.
Thanks for the quick response! Lets say I have a menu item that I want to use to call another jsp page. This new jsp page is defined as a new tile. More detail: Lets say I have a welcome page (which is defined in tiles-defs.xml). In the header.jsp I look to see if the user is logged in. If they are logged in I display a greeting in the header. If they are not logged in I print Please logon in the menu.jsp and I when they click on that I would like to jump to the logon page which is defined in the tiles-defs.xml. The logon page has a different menu.jsp and body.jsp defined. Thanks Glenn -Original Message- From: Bailey, Shane C. [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 2:25 PM To: 'Struts Users Mailing List' Subject: RE: Newbie Question: Tiles and html:link how to make it work. Your forward path can be a Tiles Def in the struts-config. You don't want to ever link directly to a Def (or JSP) so it sounds like you are fine. Need more detail otherwise. -Original Message- From: Davidson, Glenn [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 2:22 PM To: 'Struts Users Mailing List' Subject: Newbie Question: Tiles and html:link how to make it work. I am new to Struts and Tiles and am trying to make it work. I have written a simple web site that uses the html:link forward=some forward name ... and this works well. The some forward name is currently defined in the global forwards section of the struts-config.xml I have looked at the documentation on line and it is a little shy on this. I also have Ted Husted's book which is really great but I am still having a problem. Can anyone get me some guidance here? Thanks Glenn Davidson - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie Question: Tiles and html:link how to make it work.
Like I said. Don't link to any JSPs from a JSP. So you need to look into things a little more or you will have problems in the long run. If you really don't need to do any type of preparation for the display of a JSP (i.e. nothing put in the request,session,etc. for the JSP to pull out) then use: actionpath=/home parameter=doc.welcome type=org.apache.struts.action.ForwardAction scope=request /action Most of the time you will want to go to a real action and do something. Especially a check for login (already authenticated). You shouldn't do it in every JSP (that's what it sounds like you are doing). I suggest to subclass the ActionServlet to do a login check. I hope this helps but you really should learn more before doing your implementation of struts. I feel I have the basics of struts decently but learn something all the time on this forum. -Original Message- From: Davidson, Glenn [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 2:45 PM To: 'Struts Users Mailing List' Subject: RE: Newbie Question: Tiles and html:link how to make it work. Thanks for the quick response! Lets say I have a menu item that I want to use to call another jsp page. This new jsp page is defined as a new tile. More detail: Lets say I have a welcome page (which is defined in tiles-defs.xml). In the header.jsp I look to see if the user is logged in. If they are logged in I display a greeting in the header. If they are not logged in I print Please logon in the menu.jsp and I when they click on that I would like to jump to the logon page which is defined in the tiles-defs.xml. The logon page has a different menu.jsp and body.jsp defined. Thanks Glenn -Original Message- From: Bailey, Shane C. [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 2:25 PM To: 'Struts Users Mailing List' Subject: RE: Newbie Question: Tiles and html:link how to make it work. Your forward path can be a Tiles Def in the struts-config. You don't want to ever link directly to a Def (or JSP) so it sounds like you are fine. Need more detail otherwise. -Original Message- From: Davidson, Glenn [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 2:22 PM To: 'Struts Users Mailing List' Subject: Newbie Question: Tiles and html:link how to make it work. I am new to Struts and Tiles and am trying to make it work. I have written a simple web site that uses the html:link forward=some forward name ... and this works well. The some forward name is currently defined in the global forwards section of the struts-config.xml I have looked at the documentation on line and it is a little shy on this. I also have Ted Husted's book which is really great but I am still having a problem. Can anyone get me some guidance here? Thanks Glenn Davidson - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie Question: Tiles and html:link how to make it work.
Shane, You have been most helpful and correct. Please bear with me for one more moment. When I do my links I link to a forward and not directly to a JSP. I agree that the best way to handle the is logged in question is by sub classing the ActionServlet (Ted Husted's Book has a nice example of this). What I have working is this: I create a link to a forward, the forward is mapped to a JSP, within the JSP is a tiles include definition. If I have an action the forward of the action mapping is taking the tiles definition and working correctly. Is this the correct way of handling this? Thanks Glenn -Original Message- From: Bailey, Shane C. [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 3:19 PM To: 'Struts Users Mailing List' Subject: RE: Newbie Question: Tiles and html:link how to make it work. Like I said. Don't link to any JSPs from a JSP. So you need to look into things a little more or you will have problems in the long run. If you really don't need to do any type of preparation for the display of a JSP (i.e. nothing put in the request,session,etc. for the JSP to pull out) then use: actionpath=/home parameter=doc.welcome type=org.apache.struts.action.ForwardAction scope=request /action Most of the time you will want to go to a real action and do something. Especially a check for login (already authenticated). You shouldn't do it in every JSP (that's what it sounds like you are doing). I suggest to subclass the ActionServlet to do a login check. I hope this helps but you really should learn more before doing your implementation of struts. I feel I have the basics of struts decently but learn something all the time on this forum. -Original Message- From: Davidson, Glenn [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 2:45 PM To: 'Struts Users Mailing List' Subject: RE: Newbie Question: Tiles and html:link how to make it work. Thanks for the quick response! Lets say I have a menu item that I want to use to call another jsp page. This new jsp page is defined as a new tile. More detail: Lets say I have a welcome page (which is defined in tiles-defs.xml). In the header.jsp I look to see if the user is logged in. If they are logged in I display a greeting in the header. If they are not logged in I print Please logon in the menu.jsp and I when they click on that I would like to jump to the logon page which is defined in the tiles-defs.xml. The logon page has a different menu.jsp and body.jsp defined. Thanks Glenn -Original Message- From: Bailey, Shane C. [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 2:25 PM To: 'Struts Users Mailing List' Subject: RE: Newbie Question: Tiles and html:link how to make it work. Your forward path can be a Tiles Def in the struts-config. You don't want to ever link directly to a Def (or JSP) so it sounds like you are fine. Need more detail otherwise. -Original Message- From: Davidson, Glenn [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 2:22 PM To: 'Struts Users Mailing List' Subject: Newbie Question: Tiles and html:link how to make it work. I am new to Struts and Tiles and am trying to make it work. I have written a simple web site that uses the html:link forward=some forward name ... and this works well. The some forward name is currently defined in the global forwards section of the struts-config.xml I have looked at the documentation on line and it is a little shy on this. I also have Ted Husted's book which is really great but I am still having a problem. Can anyone get me some guidance here? Thanks Glenn Davidson - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie Question: Tiles and html:link how to make it work.
Believe me there are many ways to do it and I am not the best but I like to treat any JSP defined in the tiles def xml and any JSPs that are like templates as in classic_layout.jsp which assembles all of the other JSPs as the equivalent of an abstract class and I don't forward to any of those. I will extend (in the tiles def xml file) the doc.classicLayout, which uses classic_layout.jsp to assemble the look of the page, and those extended defs are what I forward to. So Tiles is doing all my assembly. doc.umHome extends doc.classicLayout and then I forward to doc.umHome if that is where I want to go. In posts from yesterday or the day before I posted exactly how I do it for a concrete example. -Original Message- From: Davidson, Glenn [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 4:48 PM To: 'Struts Users Mailing List' Subject: RE: Newbie Question: Tiles and html:link how to make it work. Shane, You have been most helpful and correct. Please bear with me for one more moment. When I do my links I link to a forward and not directly to a JSP. I agree that the best way to handle the is logged in question is by sub classing the ActionServlet (Ted Husted's Book has a nice example of this). What I have working is this: I create a link to a forward, the forward is mapped to a JSP, within the JSP is a tiles include definition. If I have an action the forward of the action mapping is taking the tiles definition and working correctly. Is this the correct way of handling this? Thanks Glenn -Original Message- From: Bailey, Shane C. [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 3:19 PM To: 'Struts Users Mailing List' Subject: RE: Newbie Question: Tiles and html:link how to make it work. Like I said. Don't link to any JSPs from a JSP. So you need to look into things a little more or you will have problems in the long run. If you really don't need to do any type of preparation for the display of a JSP (i.e. nothing put in the request,session,etc. for the JSP to pull out) then use: actionpath=/home parameter=doc.welcome type=org.apache.struts.action.ForwardAction scope=request /action Most of the time you will want to go to a real action and do something. Especially a check for login (already authenticated). You shouldn't do it in every JSP (that's what it sounds like you are doing). I suggest to subclass the ActionServlet to do a login check. I hope this helps but you really should learn more before doing your implementation of struts. I feel I have the basics of struts decently but learn something all the time on this forum. -Original Message- From: Davidson, Glenn [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 2:45 PM To: 'Struts Users Mailing List' Subject: RE: Newbie Question: Tiles and html:link how to make it work. Thanks for the quick response! Lets say I have a menu item that I want to use to call another jsp page. This new jsp page is defined as a new tile. More detail: Lets say I have a welcome page (which is defined in tiles-defs.xml). In the header.jsp I look to see if the user is logged in. If they are logged in I display a greeting in the header. If they are not logged in I print Please logon in the menu.jsp and I when they click on that I would like to jump to the logon page which is defined in the tiles-defs.xml. The logon page has a different menu.jsp and body.jsp defined. Thanks Glenn -Original Message- From: Bailey, Shane C. [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 2:25 PM To: 'Struts Users Mailing List' Subject: RE: Newbie Question: Tiles and html:link how to make it work. Your forward path can be a Tiles Def in the struts-config. You don't want to ever link directly to a Def (or JSP) so it sounds like you are fine. Need more detail otherwise. -Original Message- From: Davidson, Glenn [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 2:22 PM To: 'Struts Users Mailing List' Subject: Newbie Question: Tiles and html:link how to make it work. I am new to Struts and Tiles and am trying to make it work. I have written a simple web site that uses the html:link forward=some forward name ... and this works well. The some forward name is currently defined in the global forwards section of the struts-config.xml I have looked at the documentation on line and it is a little shy on this. I also have Ted Husted's book which is really great but I am still having a problem. Can anyone get me some guidance here? Thanks Glenn Davidson - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
Newbie question: how does MyAction class handle Exceptions?
Hi, I have DataAccessException thrown by DAO class and catched by BusinessDeligate class. ApplicationException thrown by BusinessDeligate class and catched by MyAction class. I want to send a jsp to clients to display a message that the clients submit a duplicate entry in their request. What should I do for this? Thanx. Leon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie question: how does MyAction class handle Exceptions?
Return a forward appropriate to the exception caught? -Original Message- From: Leon [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 27, 2003 2:45 PM To: Struts Users Mailing List Subject: Newbie question: how does MyAction class handle Exceptions? Hi, I have DataAccessException thrown by DAO class and catched by BusinessDeligate class. ApplicationException thrown by BusinessDeligate class and catched by MyAction class. I want to send a jsp to clients to display a message that the clients submit a duplicate entry in their request. What should I do for this? Thanx. Leon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Newbie question: how does MyAction class handle Exceptions?
I should forward an ApplicationException to MyAction class and then, MyAction finds an appropriate jsp based on the message in ApplicationException. But, how can I know the SQLException thrown by persistance tire is duplicate entery SQLException or other SQLException? Thanks. - Original Message - From: Mike Jasnowski [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, May 27, 2003 2:45 PM Subject: RE: Newbie question: how does MyAction class handle Exceptions? Return a forward appropriate to the exception caught? -Original Message- From: Leon [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 27, 2003 2:45 PM To: Struts Users Mailing List Subject: Newbie question: how does MyAction class handle Exceptions? Hi, I have DataAccessException thrown by DAO class and catched by BusinessDeligate class. ApplicationException thrown by BusinessDeligate class and catched by MyAction class. I want to send a jsp to clients to display a message that the clients submit a duplicate entry in their request. What should I do for this? Thanx. Leon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Newbie question: how does MyAction class handle Exceptions?
Leon wrote: I should forward an ApplicationException to MyAction class and then, MyAction finds an appropriate jsp based on the message in ApplicationException. But, how can I know the SQLException thrown by persistance tire is duplicate entery SQLException or other SQLException? Put an informative message in the DAO code that constructs the SQLException. Some people then generate an email from the exception message and send it to the administrator email account. Other people might do something more technical such as send a JMS message that there is a problem. Or even open a socket and fire a simple XML message to some web service containing the contents of the exception. These ideas require you to have established a facility to receive and store such messages (JMS or web service), and might not be worth the added complexity. Other people don't care if the user sees the exception message and they just print a message like Please copy the contents of this stack trace into an email and send it to the admin. This is the easy, if ugly, solution. Erik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie question: how does MyAction class handle Exceptions?
How about catching the database exception in the middle tier and throwing a more middle tier like Exception (so your front tier - any of the struts classes - don't have to deal with anything with SQL in it) that you define like UserExistsException or InvalidSomethingException or ThisHappenedException and then in the struts config have global-exceptions exception key=errors.user.exists type=my.exception.UserExistsException path=doc.explainUserError //If you were using tiles defs //or the JSP name otherwise / /global-exceptions I like keeping the try catches out of my Action class. -Original Message- From: Leon [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 27, 2003 3:33 PM To: Struts Users Mailing List Subject: Re: Newbie question: how does MyAction class handle Exceptions? I should forward an ApplicationException to MyAction class and then, MyAction finds an appropriate jsp based on the message in ApplicationException. But, how can I know the SQLException thrown by persistance tire is duplicate entery SQLException or other SQLException? Thanks. - Original Message - From: Mike Jasnowski [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, May 27, 2003 2:45 PM Subject: RE: Newbie question: how does MyAction class handle Exceptions? Return a forward appropriate to the exception caught? -Original Message- From: Leon [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 27, 2003 2:45 PM To: Struts Users Mailing List Subject: Newbie question: how does MyAction class handle Exceptions? Hi, I have DataAccessException thrown by DAO class and catched by BusinessDeligate class. ApplicationException thrown by BusinessDeligate class and catched by MyAction class. I want to send a jsp to clients to display a message that the clients submit a duplicate entry in their request. What should I do for this? Thanx. Leon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
NewBie Question
Hi to all, I am new to Struts-Tiles(1-day), I am new to this technology, i would to use it in a web-application, My questions is: Can the Struts-Tile colloborate Ok with JavaScript and XSLT. In other words can in a Jsp Page use Java Script XSLT with Tiles and work OK? Thanks in advance. E.K. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: NewBie Question
Tiles are what you use to put JSP together instead of using include tags. The files you have are still JSP pages, and yes, you can use JS in them just fine. Once the page is at the users browser, it is still 1 web page. That is when the JS actually gets used anyways. As far as XSLT, I can't help.. Sorry. -Original Message- From: Vangelis Konstantinis [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 1:42 PM To: [EMAIL PROTECTED] Subject: NewBie Question Hi to all, I am new to Struts-Tiles(1-day), I am new to this technology, i would to use it in a web-application, My questions is: Can the Struts-Tile colloborate Ok with JavaScript and XSLT. In other words can in a Jsp Page use Java Script XSLT with Tiles and work OK? Thanks in advance. E.K. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Visit our website at http://www.ubswarburg.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]