Re: Error... Instanciate a new bean
Take a look at the tag. If you use "homeForm" for the "name" property and one of the form's properties for the "property" property you're all set. Example: Regards, Guus - Original Message - From: stephane roro To: [EMAIL PROTECTED] Sent: Friday, August 24, 2001 13:31 Subject: Error... Instanciate a new bean Hi, i have a problem in using Struts. My home.do launch my homeAction.class and my homeForm.class . So all attributes of my bean are filled . But, when my jsp desire to use my bean (homeForm.class) using , it instanciate a new bean of homeForm.class (So all attribute are null) and it doesn't use the bean that i filled . Does someone can help me please? Regards, stephaneStéphane RODIERE 0622087230 [EMAIL PROTECTED] Téléchargez MSN Explorer gratuitement à l'adresse http://explorer.msn.com
Re: session ids
You can retrieve the current user's "session id" from the HttpSessionBindingEvent e using "e.getSession().getId()". Use this value to look up an entry in your hastable and remove it. The HttpSessionBindingEvent is generated when the session is invalidated (valueUnbound()) or created (valueBound()). For more details read the Java doc on HttpSessionBindingEvent. Make sure your class maintaining the hashtable implements the javax.servlet.http.HttpSessionBindingListener interface. Regards, Guus - Original Message - From: "Rakesh" <[EMAIL PROTECTED]> To: "Jon Crater" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Sunday, August 19, 2001 12:01 Subject: Re: session ids > do u have an example > > > Rakesh Ayilliath > > [EMAIL PROTECTED] > > - Original Message - > From: "Jon Crater" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Thursday, August 16, 2001 10:27 PM > Subject: Re: session ids > > > > rakesh-- > > > > you can solve this problem by having the class responsible for managing > the > > hashtable of session ids implement HttpSessionBindingListener. fill out > the > > valueBound(HttpSessionBindingEvent event) and > > valueUnbound(HttpSessionBindingEvent event) methods so that the > appropriate > > session id is added/removed when the hashtable manager is unbound from the > > session. > > > > jon > > > > > > Original Message Follows > > From: "Rakesh" <[EMAIL PROTECTED]> > > Reply-To: "Rakesh" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> > > Subject: Re: session ids > > Date: Thu, 16 Aug 2001 22:12:50 +0530 > > > > Hi Greg, > > > > I know that this sessioncontext api is currently deprecated. > > I require this for a very specific reason. When I log-in a user, > > I save his loginID and the sessionId in a static hash table. > > > > and when he is logged out, I remove it. Each time someone tries > > to log-in, I check in to the hash to see if he is already logged in and > > display appropriate error messages to him. > > > > When he logs out by clicking on a logout.do, I remove his > > loginID from the hash and invalidate his session. Now what happens; if > > he just closes the browser window, or if his session is timed out ? > > How do I remove his name from the Hash ? > > > > Kindly help. > > > > Rakesh Ayilliath > > [EMAIL PROTECTED] > > > > > > > > - Original Message - > >From: Greg Maletic > >To: [EMAIL PROTECTED] ; Rakesh > >Sent: Thursday, August 16, 2001 9:54 PM > >Subject: RE: session ids > > > > > >I don't believe you can get all valid sessionIDs from the server. I > > think the API for doing so was deprecated a while back for security > reasons. > > The way I've solved this in the past was to have each session register > > itself into a application-scoped hashmap, and maintain that map myself. > > > >--Greg > > > > > > -Original Message- > >From: > [EMAIL PROTECTED] > > > [mailto:[EMAIL PROTECTED]]O > n > > Behalf Of Rakesh > >Sent: Thursday, August 16, 2001 12:28 AM > >To: [EMAIL PROTECTED] > >Subject: session ids > > > > > > Hi , > > > > Is there anyway I can get all valid session ids from the server ? > > > > > > Rakesh Ayilliath > > (Software Engineer) > > > > Synergy IT Innovations Pvt Ltd, > > #196, 1st Floor, 9th Cross, > > HMT Layout, RT Nagar > > Bangalore 560032 > > > > [EMAIL PROTECTED] > > > > > > _ > > Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp > > > > >
Re: Validating a form
Alexandre, The input attribute must be added to the action mapping as follows: where the "input" attribute should contain the name of the JSP you use to input for the requete action (I assumed it to be '/requete.jsp'). Regards, Guus - Original Message - From: "DUPRAT Alexandre" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, August 20, 2001 11:00 Subject: RE: Validating a form Hi agian, Excuse me for being late in my response but i'm currently between too projects... Craig, when you say : "Note that you *must* specify an input attribute on your , so that Struts knows where to send the user back to." What do i need to do, what is the name of this input attribute? Do you have an example of struts-config.xml code matching the case. Here is mine: http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd";> I beleve there is something missing in the action node, but what? Perhaps struts does not know what page to display when finding errors. How can i tell it where to go? (another forward???) Thanks for help. -Message d'origine- De: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Date: lundi 6 août 2001 18:35 À: '[EMAIL PROTECTED]' Objet: Re: Validation a form On Mon, 6 Aug 2001, DUPRAT Alexandre wrote: > hi, > > How can i validate a form? > I tried : > public ActionErrors validate(ActionMapping mapping, HttpServletRequest req) > { > ActionErrors errors= new ActionErrors(); > if(! getSqlQuery().startsWith("select")){ > ActionError error = new ActionError("error.requete"); > errors.add("sqlQuery", error); > } > return errors; > } > > it works when there is no error but not when i've one > Is there somebody with an idea? > The above code looks OK -- what about it doesn't work? Note that you *must* specify an input attribute on your , so that Struts knows where to send the user back to. > Alexandre Duprat > SOPRA. Direction France Sud. Bordeaux > [EMAIL PROTECTED] > Craig McClanahan ++ | Ce courrier ainsi que les fichiers joints sont confidentiels. | | Si vous avez recu ce courrier par erreur, veuillez en informer | | l'administrateur du systeme : [EMAIL PROTECTED] | | - | | Ce message confirme que le courrier a passe le controle| | antivirus du relais de messagerie Internet avec succes.| ++
Re: -tag problem
Maybe you can use a tag. Regards, Guus - Original Message - From: "BinhMinh Nguyen" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; "Anthony Xin Chen" <[EMAIL PROTECTED]> Sent: Friday, August 17, 2001 03:00 Subject: -tag problem > hi, > Here is my problem: > I have to use pre-populate method to pre-fill the > toForm based on some data from the previous JSP, > called 'fromForm', but the only HTML components > available for me is to use , since I can > set the property such as > > > But, as you all know, the text-tag does not provide a > good looking, because the user dont need to enter > anything into the text-field. Then I set the attribute > 'disabled="true", but it can only make little > improvement. > > > How do I make my text-field, using tag, > look like there is no text-field there at all? Or any > other HTML-comp I can use instead > > Thank you very much > > Binh Nguyen > > __ > Do You Yahoo!? > Make international calls for as low as $.04/minute with Yahoo! Messenger > http://phonecard.yahoo.com/ >
Re: problem
Are you sure that you have an "input" entry in your action mapping in your struts-config.xml file pointing to the JSP where you want to end up? If you don't provide an input entry you forward into the blueand not to the JSP where you expect to end up. You could also use the relative URL of your JSP to create an actionforward (new ActionForward( "" )) Regards, Guus - Original Message - From: "SUPRIYA MISRA" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, August 15, 2001 16:39 Subject: RE: problem > I have used exactly what he is doing without validating and it works > > > >From: Mike Dewhirst <[EMAIL PROTECTED]> > >Reply-To: [EMAIL PROTECTED] > >To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]> > >Subject: RE: problem > >Date: Wed, 15 Aug 2001 15:36:49 +0100 > > > >I think the problem stems from the fact that you are creating and > >populating > >the ActionErrors object in the Action Class instead of the validate > >method() > >of the Action Form. You should also turn on validation in the action maping > >for this Action in strus-config.xml. > > > >Hope this helps! > > > >Have a look at the user guide, it's very good and contains the details on > >how to do the above: http://jakarta.apache.org/struts/userGuide/index.html > > > >-Original Message- > >From: Yang, Yexing [mailto:[EMAIL PROTECTED]] > >Sent: 15 August 2001 15:31 > >To: '[EMAIL PROTECTED]' > >Subject: problem > > > > > >Hi,everyone > >I have a problem about using the , in Servlet side I use > >something look like following: > > > > ActionErrors errors = new ActionErrors(); > > errors.add("mike",new ActionError("Login Failed !")); > > if(!errors.empty()){ > > saveErrors(request,errors); > > System.out.println("Login Error: " + > >mapping.getInput().toString()); > > return (new ActionForward(mapping.getInput())); > > } > > > >from the std.out I can check errors is not empty, but on Jsp page , I > >use > >, it doesn't come out any error info. I am not quite sure if > >I > >am doing the right way or not. > > > >do someone can please give some advice about it > > > >Thanks in advance > > > > > >=** > > > >If you are not the intended recipient, employee or agent responsible for > >delivering the message to the intended recipient, you are hereby notified > >that any dissemination or copying of this communication and its attachments > >is strictly prohibited. > > > >If you have received this communication and its attachments in error, > >please return the original message and attachments to the sender using the > >reply facility on e-mail. > > > >Internet communications are not secure and therefore the UCLES Group does > >not accept legal responsibility for the contents of this message. Any > >views or opinions presented are solely those of the author and do not > >necessarily represent those of the UCLES Group unless otherwise > >specifically stated. > > > >This footnote also confirms that this email message has been swept by > >MIMEsweeper for the presence of computer viruses although this does not > >guarantee that this email is virus free. > > > >**= > > > _ > Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp >
Re: more than one parameter in a forward attribute in struts_config.xml
Use "&" instead of "&." Regards, Guus - Original Message - From: "Langøren, Knut Harald" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, August 15, 2001 10:42 Subject: more than one parameter in a forward attribute in struts_config.xml > Hi all ! > > We're trying to use the forward attribute in the struts-config.xml, and its > working just fine. > But is it possible to have more than one parameter in the url ? > > ex. > "/contactinformationdetails/contactInformationDetails.do?caller=contactInfor > mation&task=new" redirect="true"/> > > When we try this, the server can't parse the file properly. It doesn't like > the "&" sign. > > Any ideas ?? > > Thanks > KHL >
Re: ABSOLUTELY WORLDS NO. 1 ..MEGA !
I am not interested in this kind of spam! Please see to it that I won't recieve this again. - Original Message - From: "ENTERTAINMENT" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, August 15, 2001 00:43 Subject: ABSOLUTELY WORLDS NO. 1 ..MEGA ! > Dear Ladies & Gentlemen, > > Welcome to the GREATEST SEX SHOW on the ENTIRE NET ! > > We now offer you to ENTER the world´s No.1 voted SEX-SERVER on the WEB ! > > By far the largest and most incredible content of LIVE SEX is now served to users WORLDWIDE! > > EVERYTHING is offered 100% ANONOMOUSLY & you don´t need to sign-up or have a creditcard ... The way it should be ! > > TO PLUGIN and get access to something you with guarantee NEVER have seen before, use ANY of the servers listed below ! > > Enjoy the BEST! > > Yours truly, > MEGA-ENTERTAINMENT > > To get EASY ACCESS & PLUGIN to the LARGEST CONTENT SEXSERVER on the NET, use any of the 10 SERVERS listed here: > > 1. http://coolestweb.fadlan.com > 2. http://coolestweb.paklinks.com > 3. http://kickme.to/coolestweb > 4. http://siam.to/coolestweb > 5. http://coolestweb.hk.st > 6. http://coolestweb.hotresume.net > 7. http://coolestweb.isCool.net > 8. http://arriveat.com/coolestwebs > 9. http://coolestweb.x1.nl > 10. http://www.actioncenter.com/c/coolestweb > > To get EASY ACCESS & PLUGIN to the LESBIAN IBIZA BABES, use any of the 10 SERVERS listed here: > > 1. http://coolestbabes.fadlan.com > 2. http://coolestbabes.paklinks.com > 3. http://kickme.to/coolestbabes > 4. http://siam.to/coolestbabes > 5. http://coolestbabes.hk.st > 6. http://coolestbabes.hotresume.net > 7. http://coolestbabes.isCool.net > 8. http://arriveat.com/coolestbabes > 9. http://coolestbabes.x1.nl > 10. http://www.actioncenter.com/c/coolestbabes > > >
Re: Accessing JDBC-ODBC from Struts
One of the - more complicated - solutions is to set up Java Naming and Directory services (JNDI, see the documentation that comes with JDK1.3). Using JNDI you can hide the details of connecting to your database(s) in a DataSource object you store in the naming service. Sun provides us with a "com.sun.jndi.fscontext.RefFSContextFactory" class that provides a filesystem naming service. Regards, Guus - Original Message - From: "Rodney Smith" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 25, 2001 15:19 Subject: Accessing JDBC-ODBC from Struts > Hi > > I need some direction on how to incorporate JDBC-ODBC into my struts > and where the ODBC should be stored in my application. Also how to reference > that in my Action Servlet, I am a little unsure about this area, but would > appreciate some feed back or documentation that will simplify my work. > > Thanks > > Rodney > > -- > Sent through GMX FreeMail - http://www.gmx.net >
Re: Problem with tag?
The documentation for the tag states the following: "Retrieves an internationalized message for the specified locale, using the specified message key, and write it to the output stream. Up to five parametric replacements (such as "{0}") may be specified. The message key may be specified directly, using the key attribute, or indirectly, using the name and property attributes to obtain it from a bean." So what I expect is that I can use the name and property attributes to retrieve a message key from the "ci" property in the "<%= Constants.STATS_KEY %>" bean! Regards, Guus - Original Message - From: "Mark Schenk" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, July 20, 2001 19:38 Subject: RE: Problem with tag? > > When I try to use > > scope="request"/> > > I get the message > > "According to TLD attribute key is mandatory for tag message" > > > > The message is incorrect, at least if I am to believe the documentation of > the BEAN TLD! > > > > Does anyone has any experience using "name" & "property" instead of "key"? > > Are you sure you're not confusing and ? What > would > you expect as output from your above tag? > > > > > -- -- > Mark Schenk | Ceci n'est pas une signature > Blackboard Project Manager | > Delft University of Technology |E-mail: [EMAIL PROTECTED] > Dept.: DTO |Phone: +31 152785448 (85448) > Room: LB00.680 |Fax:+31 152786359 > -- -- >
Problem with tag?
I am using Struts 1.0 on Tomcat 3.2.1. When I try to use I get the message "According to TLD attribute key is mandatory for tag message" The message is incorrect, at least if I am to believe the documentation of the BEAN TLD! Does anyone has any experience using "name" & "property" instead of "key"? Regards, Guus Guus Holshuijsen, VideturHorsten 1, unit 1.185612 AX Eindhoven The NetherlandsT:+31-40-2450214 F:+31-40-2939343 M:+31-6-25077204
HTTP requests in struts-config.xml
I would like to use the following request in a forward of an action in my web application's struts-config.xml file:"/doorman.do?action=lfadm.list&ci=0" But when I put in: I get XML parser errors when Tomcat starts up. And when I put in: I find that Struts does not interpret this as a parameter 'action' with value 'lfadm.list' and a parameter 'ci' with value '0' but as a parameter 'action' with value 'lfadm.list&ci=0' (note the change of %26 into &). The questions I have: 1. Is Struts designed to handle these kind of requests in a forward in struts-config.xml? 2. If the answer to 1 is yes: am I doing something wrong, or did I run into a Struts bug? 3. If the answer to 1 is no: What's another option? Regards, Guus Guus Holshuijsen, VideturHorsten 1, unit 1.185612 AX EindhovenT:+31-40-2450214 F:+31-40-2939343 M:+31-6-25077204
Re: Displaying errors when validating forms (ActionErrors)
Hartmut, I do it at the end of an action's perform() method using the "construction" given in my previous reply! What I describe is only valid if your controller checks for errors itself. In case you let Struts handle the validation automatically, I advice you to look at the Struts source code. The following code snippet is from the Action.java class: /** * The request attributes key under which your action should store an * org.apache.struts.action.ActionErrors object, if you * are using the corresponding custom tag library elements. */ public static final String ERROR_KEY = "org.apache.struts.action.ERROR"; Concluding: the errors are stored in the request (session?) attribute "org.apache.struts.action.ERROR". Regards, Guus - Original Message - From: "Hartmut Bernecker" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 18, 2001 12:48 Subject: Re: Displaying errors when validating forms (ActionErrors) > No, I think I did not! > My validate Method looks like that, it returns Errors back to the > controller servlet. > - Where is the place to save the errors in the request??? > > >public ActionErrors validate(ActionMapping pMapping, > HttpServletRequest pRequest) >{ > System.out.println("VALIDIERE"); > ActionErrors errors = new ActionErrors(); > if (iBenutzer == null || iBenutzer.length() < 1) > { > errors.add("benutzungsname", > new ActionError("error.login.benutzername.required")); > } > if (iPasswort == null || iPasswort.length() < 1) > { > errors.add("passwort", > new ActionError("error.login.passwort.required")); > } > if (iSprache == null || iSprache.length() < 2 || > iSprache.equals("blank")) > { > errors.add("sprache", > new ActionError("error.login.passwort.required")); > } > > return errors; >} > > > > Guus Holshuijsen schrieb: > > > > Do you save your errors? > > > > // Report any errors we have discovered > > if ( !errors.empty() ) > > { > > saveErrors( request, errors ); > > } > > > > Regards, > > Guus > > > > - Original Message - > > From: "Hartmut Bernecker" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Wednesday, July 18, 2001 11:55 > > Subject: Displaying errors when validating forms (ActionErrors) > > > > > Hallo, > > > > > > I have a problem to display ActionErrors. I use the validate-Method to > > > validate forms, like that: > > > > > > -- > > > public ActionErrors validate(ActionMapping mapping, HttpServletRequest > > > request) { > > > ActionErrors errors = new ActionErrors(); > > > if (iBenutzer == null || iBenutzer.length() < 1) { > > > errors.add("benutzungsname", new > > > ActionError("error.login.benutzername.required")); > > > }} > > > -- > > > > > > But when I want to display that error, I can't see anything. Why? > > > > > > * errors.header= > > > errors.footer= > > > error.login.benutzername.required=that is an error ... > > > > > > is in the property-file! That property-file is available (set in > > > web.xml)! > > > > > > * the JSP contains: > > > > > > > > > > > > Who can help me?! > > > What is wrong?? >
Re: Displaying errors when validating forms (ActionErrors)
Do you save your errors? // Report any errors we have discovered if ( !errors.empty() ) { saveErrors( request, errors ); } Regards, Guus - Original Message - From: "Hartmut Bernecker" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 18, 2001 11:55 Subject: Displaying errors when validating forms (ActionErrors) > Hallo, > > I have a problem to display ActionErrors. I use the validate-Method to > validate forms, like that: > > -- > public ActionErrors validate(ActionMapping mapping, HttpServletRequest > request) { > ActionErrors errors = new ActionErrors(); > if (iBenutzer == null || iBenutzer.length() < 1) { > errors.add("benutzungsname", new > ActionError("error.login.benutzername.required")); > }} > -- > > But when I want to display that error, I can't see anything. Why? > > * errors.header= > errors.footer= > error.login.benutzername.required=that is an error ... > > is in the property-file! That property-file is available (set in > web.xml)! > > * the JSP contains: > > > > Who can help me?! > What is wrong?? >
Re: unscribe me please!!!
To remove your address from the list, send a message to: <[EMAIL PROTECTED]> - Original Message - From: "Chittajallu, Vamsi" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, July 06, 2001 14:35 Subject: unscribe me please!!! > can you please unscribe me from the mailing list. > > thanks, > vamsi. >
Checked radio buttons
I'm trying to find out if it is possible to set a radiobutton to checked using the HTML tag library. The documentation does not describe it. Regards, Guus Guus Holshuijsen, VideturHorsten 1, unit 1.185612 AX Eindhoven The NetherlandsT:+31-40-2450214 F:+31-40-2939343 M:+31-6-25077204
Problem upgrading from struts-1.0-b1 to struts-1.0
After upgrading from struts-1.0-b1 to struts-1.0 I keep getting a servlet error with the message "can't remove attributes from request scope". This is especially annoying because it occurs in the login JSP of my application and thus it blocks my progress. I checked the installation notes several times to see if I overlooked something, but found nothing wrong. Does anyone have a suggestion? (In the mean while I'll just add the Struts source to my project and debug through it.) Regards Guus Guus Holshuijsen, VideturHorsten 1, unit 1.185612 AX Eindhoven The NetherlandsT:+31-40-2450214 F:+31-40-2939343 M:+31-6-25077204