Re: textarea
You must be carefull. You can don't see the whole text (because the \n characteres). Are you using an java IDE to debug your source ? If this is true, try to write the contents of your property in your log file... as as wrote: Hi, I am generatinga textare on my jsp with this: textarea name=info rows=12 cols=50 tabindex=0bean:write name=teacher property=qualifications //textarea BUt if i enter a large peice of text in the textarea and save it (try to save it) in my bean, its not getting the whole chunck of data (like a paragraph or a page) ANything wrong i may be doing? how to fix it... Thanks in advance - Do you Yahoo!? Yahoo! Search - Find what youre looking for faster. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: map-backed action forms - form params not loaded ?
Raghu, i think this .html is wrong. It must be like : form action=/saveParams.do input type=text name=value(param1)/ input type=text name=value(param2)/ /form Please, try it. Raghu Havaldar wrote: I do not have a problem while displaying those properties. However, when a form (which has a bunch of params like the one below) is submitted, the ActionForm's setValue method is not called. e.g. This is plain html, no jsp. form action=/saveParams.do input type=text name=param1/ input type=text name=param2/ /form Have you used a map-backed action form to capture params from a submitted form ? Have observed lots of folks having this problem. thanks, raghu - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: textarea
html:form method=post I think that post is the default but i'm not sure... as as wrote: Andreas, Thanks for the quick reply. I am using struts form tag as follows. wondering ,syntax wise, how I can mention form method as GET...in this tag. Thanks in advance, Sam. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Database password
Guillermo, we're also using DBCP. Our approach is to use our own Properties subclass. This subclass can read (and decrypt) a previously encrypted property file (using a 2-way dummy encryption algorithm)... I don't know if this is the best way but it works for us :-) object class=org.apache.commons.dbcp.DriverConnectionFactory object class=org.postgresql.Driver/ string value=jdbc:postgresql://127.0.0.1/myDatabase?charSet=UTF-8/ object class=br.com._company.service.db.connection.PoolProperties string value=my_database.properties/ /object /object Guillermo Meyer wrote: Hi: Our Struts application is currently in production. This applciation uses an Oracle Database (we are using DBCP from jakarta). We access this database through url, user a password and we need to hide the production database password. The password is stored in a configuration file and is in plain text. Have you got some best practices in this scenario? How are your Java Applications get connected to production databases and how is the database password protected? If we encrypt the password with 3DES, how should the key be protected? Cheers. Guillermo. NOTA DE CONFIDENCIALIDAD Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las personas direccionadas en el mail y puede contener informacion (i)de propiedad exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. Cualquier opinion en el contenido, es exclusiva de su autor y no representa necesariamente la opinion de Interbanking S.A. El acceso no autorizado, uso, reproduccion, o divulgacion esta prohibido. Interbanking S.A no asumira responsabilidad ni obligacion legal alguna por cualquier informacion incorrecta o alterada contenida en este mensaje. Si usted ha recibido este mensaje por error, le rogamos tenga la amabilidad de destruirlo inmediatamente junto con todas las copias del mismo, notificando al remitente. No debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni ninguna de sus partes si usted no es el destinatario. Muchas gracias. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: map-backed action forms - form params not loaded ?
How do look like the properties in your form ? Something like this : html:text property=value(test1)/ html:text property=value(test2)/ ? Are the other properties (non map-backed) ok ? Raghu Havaldar wrote: Hi, Am using Struts 1.1, WinXP. Trying to use map-backed action forms to load a dynamic list of params from a form. When the form is submitted, the params are not loaded in the action form. Am following the guidelines as speced in the Struts docs. Here's a snippet: public ParamsForm extends ActionForm { private Map params = new HashMap(); public void setValue(String key, Object value) { params.put(key, value); } public Object getValue(String key) { return params.get(key); } } Have pored over the mailing list archivers. Folks seem to have gotten this working. Any pointers ? thanks, raghu - 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: Cookies And Session Problems
Ciaran, Brian is right. Using IE, you can get a different session if you try to execute a new instance of IE (do not use Open a new window). But you must be carefull because even the links in Windows' startup menu can just Open a new window (instead starts a new IE instance). When you are using Netscape/Mozilla, try to use 2 different profiles (again, Open a new Window will make Netscape or Mozilla share the stored cookies). I hope this helps you. Brian Lee wrote: It looks like your two browser sessions are sharing the same memory used to store cookies. So your application server treats requests from both browsers as in the same session (since they send the same jsessionid cookie). In IE you used to be able to correct his by checking launch in new process in Tools|Internet Options, but I no longer see this in IE 6.0.2800.1106 If you open your site in IE and in Mozilla at the same time you will have separate sessions. BAL - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cookies And Session Problems
I think that i've found the problem. Please, look below : Ciaran Hanley wrote: Hi thanks for your reply, I am using form based authentication. Cookies are enabled. I am storing all session information using request.getSession() for example: request.getSession().getServletContext().setAttribute(user, loggedUser); stores the user bean in the session. Ciaran, you must use request.getSession().setAttribute( user,loggedUser ); When you use request.getSession().getServletContext().setAttribute(user, loggedUser); you're putting your bean at application scope... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cookies And Session Problems
I think that i've found the problem. Please, look below : Ciaran Hanley wrote: Hi thanks for your reply, I am using form based authentication. Cookies are enabled. I am storing all session information using request.getSession() for example: request.getSession().getServletContext().setAttribute(user, loggedUser); stores the user bean in the session. Ciaran, you must use request.getSession().setAttribute( user,loggedUser ); When you use request.getSession().getServletContext().setAttribute(user, loggedUser); you're putting your bean at application scope... - 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: Problems with UTF-8 and forms
I don't know if this will help but try to search charset encoding at tomcat maillist archive. You will find some tips in there. Take a look at http://tagunov.tripod.com/i18n/i18n.html (try to contact Anton, if you want). -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Monday, March 01, 2004 3:47 AM To: Struts Users Mailing List Subject: Re: Problems with UTF-8 and forms On 03/01/2004 12:29 AM Jon Bohm wrote: BUT if I rewrite my custombean's getValue method it all works fine (except for swedish uppercase letters): public String getValue() { return new String( value.getBytes(), UTF-8); } Still shouldn't be necessary. Apache Tomcat/5.0.12 Java 1.4.2_01-b06 Struts 1.1 (I think - how do I check?) Windows XP (I know, I'm a Linuxdude gone bad) Open up struts.jar in winzip or something and view META-INF/MANIFEST.mf - check implementation-version. So what does the debugging say at the end of your JSPs? Is your response UTF-8 or iso- encoded? I bet it says the page content-type is still iso-8859. How are you setting your struts controller parameter (in struts-config.xml): set-property property=contentType value=text/html; charset=UTF-8/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems with UTF-8 and forms
You can try this also: http://jakarta.apache.org/tomcat/faq/misc.html#utf8 -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Monday, March 01, 2004 3:47 AM To: Struts Users Mailing List Subject: Re: Problems with UTF-8 and forms On 03/01/2004 12:29 AM Jon Bohm wrote: BUT if I rewrite my custombean's getValue method it all works fine (except for swedish uppercase letters): public String getValue() { return new String( value.getBytes(), UTF-8); } Still shouldn't be necessary. Apache Tomcat/5.0.12 Java 1.4.2_01-b06 Struts 1.1 (I think - how do I check?) Windows XP (I know, I'm a Linuxdude gone bad) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: people using action form field
document.forms[0].action='somethig.do' works to me... to change a field with name action, i guess you must do something like document.forms[0].action.value Slattery, Tim - BLS wrote: If you use a field called action in the form, how can you change the form action with javascript. When I try to set the document.form.action it tries to set the field instead of the action for the form. Is there any other way to change the action for the form? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Getting values from two different beans in the same form
I don't know if a got it...You can use nested beans inside your ActionForm, like: FirstBean - has get/set name and get/set id SecondBean - has get/set version MyActionForm - has get/set firstBean and secondBean You can do : html:form... html:hidden property=firstBean.id/ html:text property=secondBean.version/ /html:form as as wrote: Hi, I have a question on using two beans in same form. I get the followig error: javax.servlet.jsp.JspException: No getter method for property name of bean testModule basically I am trying to access name and id of bean1 and version of bean2 to show in the same one form... is this possible.. samples appreciated. thanks much, Sam - Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Iterating List
Try logic:iterate (http://jakarta.apache.org/struts/userGuide/struts-logic.html#iterate) and bean:write (http://jakarta.apache.org/struts/userGuide/struts-bean.html#write). Look at mail archive (http://mail-archives.apache.org/eyebrowse/[EMAIL PROTECTED]). I think somebody has been sent a question like yours. I hope this helps you... Ramadoss Chinnakuzhandai wrote: I need to iterate and display collection object List containing objects of type String in my JSP, I know that if the collection is of type Array I can index and get all the objects but is there anyway I can iterate this List object and disply its String objects in my JSP(without having to convert the list to Array). Thanks for your help -Ramadoss - 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 Q
I don't know if your construction is possible (i think it is). But try to use bean:define : bean:define id=myProp name=myBean property=beanProperty/ html:link href=%=myProp%Link Text/html:link Kunal H. Parikh wrote: Hi All! Can someone tell me as to how do I call bean:write .../ inside html:link .../html:link Example: html:link href=bean:write name=myBean property=beanProperty /Link Text/html:link I investigated a little abt nested tags, but I don't think that it is applicable here. TIA, Kunal - 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: Iterating List
How about this ? logic:iterate id=myString name=myform property=ListofStringobjects bean:write name=myString/ /logic:iterate Ramadoss Chinnakuzhandai wrote: finally I got the following working.. logic:iterate id=list name=myform property=ListofStringobjects bean:define id=xyz name=list type=java.lang.String/ /logic:iterate -Ramadoss - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: help ,action path
Please, try html:form method=post action=/openReport or html:form method=post action=/myapp/openReport You can also do a view source and look the html generated by tag html:form - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: help ,action path
Sorry, my mistake. When you use view source of your browser, how does the html code look like ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: help ,action path
The exception is been generated when .jsp is rendered (and not when you submit the form), hum ? Try to enable struts debug log (in your log4j config file) and try to check the package/name of your action (in struts-config.xml)... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with Map-backed ActionForm and Key value
Try % String propertyName = value( + myId + ); % html:text title=myinput property=%=propertyName% readonly=true size=2 / Brian Boyle wrote: Hi!, Thanks for the quick response. I have already tried declaring myId as String myId = value.getCandId();. I then put myId as an argument in html:text title=myinput property=value(%=myId%) readonly=true size=2 / but the key value is still being taken literally as %=myId%. I don't know why it should be doing this because shouldn't you just be able to pass in an argument as long as it is of type String? Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Suggestion] struts-user-newbie list
It sounds good to me ! Andrew Petro wrote: Incidentally, have there been any thoughts on this list of differentiating out a struts-user-newbie list from the main struts-user list? I think it's wonderful to have a welcoming place for newbies to post questions, but I think it might also be useful to be able to differentiate opportunities to help out newbies / be helped as a newbie from opportunities to ask more difficult questions / discuss more advanced features of the framework. My two cents. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts starter
Frank, please, correct me if i'm wrong: You have a Java Bean (validUser) and an ActionForm (PersonalDetailsForm) and you want to transfer property values from validUser to PersonalDetailsForm. Is it right ? If the name of these properties are the same, you can use BeansUtil.copyProperties(dest,src) (from commons) to copy the values. Remember that the PersonalDetailsForm is also a bean (so you can direct set the values in it)... Frank Burns wrote: Hi, I'm in the middle of working with my first application using Struts and desperately need some help. I've read nearly all of Ted Husted's Struts In Action book and browsed the mailing list archives but have not found a solution for what I want to do. I mention this to let you know that I have already tried hard, unsuccessfully, to find an answer to what seems to me to be a basic requirement. However, I may be struggling with my own misunderstanding! HERE'S THE BACKGROUND I have a session bean (validUser) and I want to use its properties to initially populate a PersonalDetails form. Then I want to use the validate() method of the related ActionForm (PersonalDetailsForm) to check the newly submitted details and, if failing validation, redisplay them in the PersonalDetails form, so that the user can correct them. HERE'S THE QUESTION: Where and how do I initialize (prepopulate) the form fields with the properties from the validUser bean, but then enable them to be populated with the information entered by the user when the form fails validation? HERE'S WHAT I'VE TRIED I've tried using html:text ... tags in the form, but they only seem to accept values from either the default form bean or from a specified bean -- so that seems only to a give a single source for populating the fields. Thanks, Frank. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Multi-page session forms
Hi, everybody. Is there a pattern for multi-page session forms ? How should i proceed when using multi-page forms (like wizards) ? Must the fields be repeated (as input hidden) in all pages ? When (exactly) ActionForm.reset() will be called for forms like this ? Thanks in advance. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
1 request 2 forms
Hi. Can i use the struts mechanism to fill 2 *different* action forms from 1 http request ? I've a button in a .jsp page. When the user to press this button, i need to save a session scoped form before forward to a new page (the new page uses another form). Is is possible ? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: 1 request 2 forms
Yes, i got a error. I've just added a org.apache.struts.actions.ForwardAction (to struts initializes and populates the session scoped form - named A) between the .jsp file (which contains the button) and a previous existent action (the one which receives a new request scoped form - named B). Now, the attributes of B form are empty (i'm getting null values)... Any idea ? Geeta Ramani wrote: I have never done this but i don't see why not. When you press your submit button on your jsp, an Action is called, right? You can do whatever you want in that execute method would be my guess. So if you feel like saving one form in session scope and another in in request attribute before you forward to your new page, i don't see why you shouldn't be able to.. Do you envision a problem? Geeta - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: 1 request 2 forms
Ok :-) I have 2 .jsp files (source.jsp and destiny.jsp). Between these two, i put an action (let's call it BAction). Either destiny.jsp and B action were expecting a BForm. So : **Case 1** source.jsp - BAction (BForm) - destiny.jsp (BForm) Now, i want to insert a new action (AAction) between source.jsp and BAction. My AAction will use a AForm, like : **Case 2** source.jsp - AAction (AForm) - BAction (BForm) - destiny.jsp (BForm) But i want to struts automatic fills the properties of AForm and BForm with the parameters from my http request. I don't know why but, at case 2, when BAction receives BForm, its properties have just null values... Any glue ? I think i will use BeanUtils to fill the properties of the second form (B form)... Thanks ! Geeta Ramani wrote: Sorry, that wasn't how I understood your question.. and i'm not sure I *do* understand your question now either.. would you explain your problem and what you are trying to do once again..? Daniel Henrique Alves Lima wrote: Yes, i got a error. I've just added a org.apache.struts.actions.ForwardAction (to struts initializes and populates the session scoped form - named A) between the .jsp file (which contains the button) and a previous existent action (the one which receives a new request scoped form - named B). Now, the attributes of B form are empty (i'm getting null values)... Any idea ? Geeta Ramani wrote: I have never done this but i don't see why not. When you press your submit button on your jsp, an Action is called, right? You can do whatever you want in that execute method would be my guess. So if you feel like saving one form in session scope and another in in request attribute before you forward to your new page, i don't see why you shouldn't be able to.. Do you envision a problem? Geeta - 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: 1 request 2 forms
Solved ! I don't know why but when i use multipart-form i get an error while populating the second form (like the case of Guillermo). Then i've removed enctype from html:form and everything works ! **Case 2** source.jsp - AAction (AForm) - BAction (BForm) - destiny.jsp (BForm) Where AAction is only a org.apache.struts.actions.ForwardAction... Thanks ! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: redirects / actionErrors
Hi, I don't know if i could understand your doubt (correct me if i'm wrong) but you must forward to your .jsp page and not redirect... If you have a global forward (in your struts-config.xml) like forward name=/my_forward_name path=/my_jsp.jsp redirect=false\ the request will be forwarded to the .jsp resource. But if you have forward name=/my_forward_name path=/my_jsp.jsp redirect=true\ the request will redirected (then you will lose the attributes in your request) mucus snot wrote: Hi, I am using action errors as a means of passing messages to the request: e.g. in Action, execute method... errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(message.to.user)); saveErrors(request, errors); return mapping.findForward(Constants.REDIRECT_KEY); But if I redirect from this action to another forward that is also an action, the actionError is out of scope. I would be interested to know if (a) this is good practice - to forward to another forward (it seems to work for me) (b) there is an easy way to carry the actionError forward within storing in the session, and saving it in the redirected request. Hope I'm making sense, Thanks, al - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: redirects / actionErrors
Ok, but i think you will lose your request attributes (because redirect will generate a new request from your browser)...Session or application attributes will be preserved. mucus snot wrote: Hi, I am intending to use a redirect rather than a forward. For me, it adds clarity for the user, and also if they refresh the page, they may get something unexpected. Al - 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: Pls help on Javascript
You can find a validator example inside the struts-1.1 .tgz: struts-validator.war. Install it under Weblogic and check the validations... sougata wrote: HI Paul Thanks for the reply.can u pls let me know how to do it in weblogic.Can u pls send me a small example. Thanks Sougata -Original Message- From: Paul Stanton [mailto:[EMAIL PROTECTED] Sent: Friday, March 05, 2004 10:38 AM To: Struts Users Mailing List Subject: Re: Pls help on Javascript you can use a struts plugin called validator.. or you can write for yourself. with validator you have to write your validation in xml. - 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: Problem in iterating
If the bean is an ActionForm, you must use the name of the form in the struts-config.xml. If your bean is only a plain Java Bean, you must add it to request, session, page or application scopes (using request.setAttribute() or session.setAttribute, for instance)... Vishal Arora wrote: it's still giving same error logic:iterate id=WBSInfo name=proDataBean property=wbsInfo scope=session can not find WBSInfo bean in any scope. one thing i want to clarify like in iterate tag id= can be any name name=bean in whose set method i have set my arraylist and property= arraylist is it right - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]