Re: workflow - Re: integration with other app
Fortunately I am far enough away to avoid your kiss ;-) Please let me know, if you believe something is missing. I am sure I can give you some more hints on how to solve a specific task. The Struts Workflow Extension is a very powerful, yet low-level framework. Thus, it offers very much flexibility but sometimes the right way to achieve a solution is not as apparent as desired. Just in case you are interested: We are also offering commercial support for this extension and Struts itself. --- Matthias Adam Levine wrote: Matthias: I could kiss you! I've been struggling with this issue and have been going bald over the last week doing a lot of my own engine work. I can't wait to try this out and see if it doesn't work for me as cleanly as it looks. From: Matthias Bauer [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: workflow - Re: integration with other app Date: Fri, 12 Sep 2003 08:35:36 +0200 Martin, the Struts Workflow Extension http://www.livinglogic.de/Struts/ addresses some of the issues you raise. Especially the thing about a workflow scope. But it is also easily possible to build reusable action sequences: Consider for instance a confirmation dialog that demands the user to press a Yes and No button. You will need this multiple times within an application, but you normally want to code the necessary actions only once and reuse them in different contexts (i. e. with a customized question and return action). Please let me know, when you have any questions related to the Struts Workflow Extension. --- Matthias Martin Naskovski wrote: One thing I find particularly cumbersome in Struts is web page workflow. Currently, if I want to push Cancel for instance, or Submit on a certain page, in the Action itself, I have to hard code where to go next and/or pass any dynamically generated parameters through the request scope or the query string (if doing a sendRedirect). I also have to use hidden form fields to tell each submission button on a form, where to go next, depending on where I came from (a certain action mapping, e.g.). Is there a better way to do this, where the flow of the screens can be specified statically, or maybe if not statically at least within a screen workflow module that each action will tell that module where to go next, depending on what button was pushed on that form? Does JSF address this perhaps? Or has someone independently made a Struts pluggable module that can control screen flow? It seems there almost is a need for some sort of a 'workflow' scope, where when I start a certain use-case from one of the menus in the application, the 'workflow scope' is preserved throughout the use-case lifetime, and if for some reason this flow is broken by the user, the workflow scope should be destroyed. I've been able to immitate a workflow scope with the session scope, but it isn't as elegant as I want it to be, or rather, as delimited from the application logic as I'd like it to be... Plus stuff in the session scope hangs around much longer than as if I had a workflow scope. I've been wondering if there's any solutions already to this - it seems that is the _only_ thing Struts is lacking in. Thanks. Martin -- Thursday, September 11, 2003, 4:31:29 PM, you wrote: TH This seems more in scope for some of the ServerSide forums than Struts. TH http://www.theserverside.com/home/index.jsp TH Our framework ends where the database begins -:0) TH Tiles is sufficient for customizating layout and such. TH -Ted. TH Gregory Seidman wrote: TH snip/ My purpose in posting this to the list is to get the benefit of the membership's collective experience. Is Torque a good choice? Is creating a separate database for each user unacceptable from the point of view of a website which provides services on a per-user basis? Is Tiles sufficient for customizing layout and such? Any suggestions, tales of woe, or design critiques are appreciated. Please do not CC me; I am subscribed to the list. --Greg - 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] _ Get a FREE computer virus scan online from McAfee. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -
[help] Share Session Problem
Hi, all I have a session problem in my struts applications. How do I share session context between two different web applications? BR xlen
TreeMap and html:optionsCollection
Dear Struts users, I am trying to get my html:optionsCollection to work with a TreeMap. I don't know if this is possible but on the Struts API page for the class OptionsCollectionTag I read the following: The collection may be an array of objects, a Collection, an Enumeration, an Iterator, or a Map. (http://jakarta.apache.org/struts/api/org/apache/struts/taglib/html/Opti onsCollectionTag.html) Since TreeMap implements SortedMap which is a subinterface of Map, TreeMap should work fine, right? However, when the page is loaded I get the folloing error text: HTTP ERROR: 500 No getter method available for property label for bean under name 1=LabelValueBean[Label 1, Value 1] Can anyone explain this error message? This seems strange to me. The returntype in my ActionFormBean is TreeMap and the code snippet where I build up the TreeMap is like this: eventGroups = new TreeMap(); eventGroups.put( new String( 1 ), new LabelValueBean( Label 1, Value 1 ) ); eventGroups.put( new String( 2 ), new LabelValueBean( Label 2, Value 2 ) ); eventGroups.put( new String( 3 ), new LabelValueBean( Label 3, Value 3 ) ); ((EventGroupBean)form).setEventGroups( eventGroups ); ( Best regards Lasse - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Dateformat for MSSQL DB
Hello, i want to parse a date from a inputfield and write it to DB (MSSQL Server) is there a method to format a date for MSSQL ? or for ODBC Datasources ? something like: DateFormat df ..., date = df.parse() ... date = df.FormatForODBC() . Mit freundlichen Grüßen Christian Reps, Dipl. Inf. (FH) Web Applications - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Dateformat for MSSQL DB
You can use a PreparedStatement, so you don't have to change your code for every database. queryString = insert into table (column) values (?); preparedStatement = connection.prepareStatement(queryString); i = 1; * Calendar c = Calendar.getInstance(); // this is for current time java.sql.Date d = new java.sql.Date(c.getTimeInMillis()); preparedStatement.setDate(i++, d); insertedRows = preparedStatement.executeUpdate(); Maybe you can change * by Calendar c = df.getCalendar -Mensaje original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Enviado el: lunes, 15 de septiembre de 2003 9:53 Para: [EMAIL PROTECTED] Asunto: Dateformat for MSSQL DB Hello, i want to parse a date from a inputfield and write it to DB (MSSQL Server) is there a method to format a date for MSSQL ? or for ODBC Datasources ? something like: DateFormat df ..., date = df.parse() ... date = df.FormatForODBC() . Mit freundlichen Grüßen Christian Reps, Dipl. Inf. (FH) Web Applications - 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]
Errors / Messages
In validate, if you add an error to the message list, validator returns without forwarding. Has anyone done anything with an alternate message file or prioritized messages, so you can add a message yet still forward. Thanks in advance. Edgar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Dateformat for MSSQL DB
This is a simple class I use to format date from VOs to Form and vice versa. Hope it's helpful import java.text.DateFormat; import java.text.Format; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class FormatUtility { public FormatUtility() { } public static String formatDate( String date ) throws ParseException { Format formatter = new SimpleDateFormat( -MM-dd HH:mm:ss.S ); Date dateD; try { dateD = ( Date )formatter.parseObject( date ); formatter = new SimpleDateFormat( dd-MM- ); date = formatter.format( dateD ); } catch( NullPointerException e ) { // Do nothing } catch( ParseException e ) { // Do nothing } return date; } public static Date getDate( String dateStr ) throws Exception { DateFormat df; SimpleDateFormat sdf = new SimpleDateFormat( dd-MM- ); Date date = sdf.parse( dateStr ); return date; } } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 3:53 PM To: [EMAIL PROTECTED] Subject: Dateformat for MSSQL DB Hello, i want to parse a date from a inputfield and write it to DB (MSSQL Server) is there a method to format a date for MSSQL ? or for ODBC Datasources ? something like: DateFormat df ..., date = df.parse() ... date = df.FormatForODBC() . Mit freundlichen Grüßen Christian Reps, Dipl. Inf. (FH) Web Applications - 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: Errors / Messages
Edgar, What is your aim in doing this? If there is a validation error, the Struts framework sends the user back to the input page to inform them of the problem, and possibly allow them to fix it and resubmit. If the request still gets passed to the action, the action will need to do conditional processing based on the presence of errors, and then it is unclear how control will pass back to Struts so that it can send the user back to the input page to inform them of what went wrong. I have sometimes thought about having the action produce a validation-style error if something goes wrong in processing the request, after which it could pass control back to the Struts framework to send the user back to the input page. You can of course add another forward or something, but it would be nice if you could just tell Struts more cleary that something went wrong and that Struts should send the user back to the input form (as it does with a validation error), but I am not sure if there is an elegant way to do that. This is distinct from your proposed flow, but it seems the same feature (tell Struts there was an error and user should be sent back to input form) could support both of our scenarios. What is the scenario you wish to support with the control flow that are looking for? -Max - Original Message - From: Edgar P Dollin [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, September 15, 2003 2:54 AM Subject: Errors / Messages In validate, if you add an error to the message list, validator returns without forwarding. Has anyone done anything with an alternate message file or prioritized messages, so you can add a message yet still forward. Thanks in advance. Edgar - 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: Dateformat for MSSQL DB
I think you should not use this class. I has some bugs in it Mohd Amin Mohd Din [EMAIL PROTECTED] 09/15/2003 12:11 PM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To 'Struts Users Mailing List' [EMAIL PROTECTED] cc Subject RE: Dateformat for MSSQL DB This is a simple class I use to format date from VOs to Form and vice versa. Hope it's helpful import java.text.DateFormat; import java.text.Format; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class FormatUtility { public FormatUtility() { } public static String formatDate( String date ) throws ParseException { Format formatter = new SimpleDateFormat( -MM-dd HH:mm:ss.S ); Date dateD; try { dateD = ( Date )formatter.parseObject( date ); formatter = new SimpleDateFormat( dd-MM- ); date = formatter.format( dateD ); } catch( NullPointerException e ) { // Do nothing } catch( ParseException e ) { // Do nothing } return date; } public static Date getDate( String dateStr ) throws Exception { DateFormat df; SimpleDateFormat sdf = new SimpleDateFormat( dd-MM- ); Date date = sdf.parse( dateStr ); return date; } } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 3:53 PM To: [EMAIL PROTECTED] Subject: Dateformat for MSSQL DB Hello, i want to parse a date from a inputfield and write it to DB (MSSQL Server) is there a method to format a date for MSSQL ? or for ODBC Datasources ? something like: DateFormat df ..., date = df.parse() ... date = df.FormatForODBC() . Mit freundlichen Grüßen Christian Reps, Dipl. Inf. (FH) Web Applications - 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]
Grid Layout Style In Struts
Hi, I'm displaying my data on my page row by row and each row containing Itemname, id, and quantity. I'm displaying this by the Struts Iterate tag. It is working fine but I want to change the quantity field, suppose there are 10 quantity on a certain row and I want to change its value to 5 and save this value to my session. How can this be done. Thank you. Mahbub _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Calling an action of One page from another page
Hi, I have a master page that have a small pop up page. I change some value of here. For taking affect the change in the master page I have to call the master page action again, but I want it to be done automatically. For example, after completing my child page's work I want to call the master page's action on Master page and refresh it value. How this could be done. Thank you. Mahbub _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Session Tracking in Struts
I am making a simple JSp which have single text item.I have to retrive this text item value on another JSp page using Struts(not by request.getParameter(textname) ). I tried with bean write,but it won't work . Pls help naveen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session Tracking in Struts
Then set it inyour action that refers to the second jsp page by request.setAttribute... F. - Original Message - From: Naveen Mudgal [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, September 15, 2003 2:33 PM Subject: Session Tracking in Struts I am making a simple JSp which have single text item.I have to retrive this text item value on another JSp page using Struts(not by request.getParameter(textname) ). I tried with bean write,but it won't work . Pls help naveen - 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: [help] Share Session Problem
See the servlet specification, section 7.3 Session scope. The short answer is that its non trivial to implement a solution for this problem. You may want to search the archives because this sort of thing has been discussed here. You may also want to do a Google search on sharing sessions in web applications. robert -Original Message- From: [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 3:02 AM To: [EMAIL PROTECTED] Subject: [help] Share Session Problem Hi, all I have a session problem in my struts applications. How do I share session context between two different web applications? BR xlen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
java.lang.ArrayIndexOutOfBoundsException
I have a jsp page that is using nested:iterate to show a list of records, based on some input on the same page. The first time I press the submit button to get the records, everything works like it should. But if I try to get the records one more time, I get this exception: javax.servlet.ServletException: BeanUtils.populate at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1254) at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at com.havleik.dt.framework.filter.AuthFilter.doFilter(AuthFilter.java:78) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619) at java.lang.Thread.run(Thread.java:534) root cause java.lang.ArrayIndexOutOfBoundsException at java.lang.reflect.Array.get(Native Method) at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:525) at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:428) at org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:770) at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:801) at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:881) at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252) at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at
RE: Q : Calling an action via a java URL ?
if you are getting an error related with FileAccess error,, you can try another HTTP Client Api , if you are using SUN Http Client api , when you want to access some sites such as www.google, www.mdb you would get FileAccess error,, -Original Message- From: Henry Voyer [mailto:[EMAIL PROTECTED] Sent: Sunday, September 14, 2003 6:50 AM To: [EMAIL PROTECTED] Subject: Q : Calling an action via a java URL ? hi fellow programmers im trying to call a struts action via http in a java program. Something like URL (Action to call) http://localhost:8443/printHelloWorld.do this returns a blank page with the text Hello World I want to read this input from a java program using something like URL u = new URL(notificationServiceURL); URLConnection uc = u.openConnection(); uc.setDoOutput(true); uc.setRequestProperty(Content-Type, application/x-www-form-urlencoded); PrintWriter pw = new PrintWriter(uc.getOutputStream()); pw.close(); BufferedReader in = new BufferedReader(new InputStreamReader( uc.getInputStream())); String res = in.readLine() .trim(); in.close(); But i keep getting some errors. Has someone tried this before? with parameters, properties, etc etc? Thanks a lot _ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail - 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: Dateformat for MSSQL DB
What bug? The formatDate( String date ) changes a format to another format. In this instance, changes from -MM-dd HH:mm:ss.S to dd-MM- getDate( String dateStr ) is used to convert a string to a java.util.Date object. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 6:48 PM To: Struts Users Mailing List Subject: RE: Dateformat for MSSQL DB I think you should not use this class. I has some bugs in it Mohd Amin Mohd Din [EMAIL PROTECTED] 09/15/2003 12:11 PM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To 'Struts Users Mailing List' [EMAIL PROTECTED] cc Subject RE: Dateformat for MSSQL DB This is a simple class I use to format date from VOs to Form and vice versa. Hope it's helpful import java.text.DateFormat; import java.text.Format; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class FormatUtility { public FormatUtility() { } public static String formatDate( String date ) throws ParseException { Format formatter = new SimpleDateFormat( -MM-dd HH:mm:ss.S ); Date dateD; try { dateD = ( Date )formatter.parseObject( date ); formatter = new SimpleDateFormat( dd-MM- ); date = formatter.format( dateD ); } catch( NullPointerException e ) { // Do nothing } catch( ParseException e ) { // Do nothing } return date; } public static Date getDate( String dateStr ) throws Exception { DateFormat df; SimpleDateFormat sdf = new SimpleDateFormat( dd-MM- ); Date date = sdf.parse( dateStr ); return date; } } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 3:53 PM To: [EMAIL PROTECTED] Subject: Dateformat for MSSQL DB Hello, i want to parse a date from a inputfield and write it to DB (MSSQL Server) is there a method to format a date for MSSQL ? or for ODBC Datasources ? something like: DateFormat df ..., date = df.parse() ... date = df.FormatForODBC() . Mit freundlichen Grüßen Christian Reps, Dipl. Inf. (FH) Web Applications - 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]
Re: assigning a value back to a bean in a logic:iterate?
Can't I just do something like: logic:equal property=cColor value=content_tbl_white %= cColor = content_tbl_blue % test cellColor /logic:equal But this does not work either. The logic _does_ find the cColor as content_tbl_white --- Thanks Mick Knutson http://www.baselogic.com +001(805) 563-0666 Office +001 (708) 570-2772 Fax --- - Original Message - From: Mohan Radhakrishnan [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Friday, September 12, 2003 8:48 AM Subject: RE: assigning a value back to a bean in a logic:iterate? If you just want to alternate within the loop you can do something like this logic:iterate id=item name=list indexId=index %=index% /logic:iterate This will print 'index'. So you can do something like this if( index % 2 == 0 ){ // Do something } else if( index % 2 == 1 ){ // Do something } You might also use the logic:equal tag instead of scriptlets. Mohan -Original Message- From: Mick Knutson [mailto:[EMAIL PROTECTED] Sent: Friday, September 12, 2003 8:06 PM To: Struts Users Mailing List Subject: Re: assigning a value back to a bean in a logic:iterate? I am basically trying to take cellColor which is a variable in my DynaForm, and loop through an array of alerts[] that is also in this DynaForm. So I can then alternate the cell colors of the table. So alertForm.cellColor need to be changed each iteration of this loop. --- Thanks Mick Knutson http://www.baselogic.com +001(805) 563-0666 Office +001 (708) 570-2772 Fax --- - Original Message - From: Mohan Radhakrishnan [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Friday, September 12, 2003 7:33 AM Subject: RE: assigning a value back to a bean in a logic:iterate? bean:parameter id=cellColor name=cellColor value=content_tbl_blue / This code defines a scripting variable but I think that since you don't have any html controls this value is not automatically sent with the request. In our JSP's where we don't have html controls we use the following code. logic:iterate id=timeSheetItem name=timeSheetEntryForm property=timeSheetItems bean:write name=timeSheetItem property=tuesdayTime / html:hidden name=timeSheetItem property=tuesdayTime/ /logic:iterate Mohan -Original Message- From: Mick Knutson [mailto:[EMAIL PROTECTED] Sent: Friday, September 12, 2003 7:44 PM To: struts Subject: assigning a value back to a bean in a logic:iterate? I have the following code I want to make work: logic:iterate id=alert name=alertListForm property=userAlerts stuff logic:equal name=alertListForm property=cellColor value=content_tbl_white bean:parameter id=cellColor name=cellColor value=content_tbl_blue / /logic:equal logic:equal name=alertListForm property=cellColor value=content_tbl_blue bean:parameter id=cellColor name=cellColor value=content_tbl_white / test blue /logic:equal /logic:iterate But I can't seem assign cellColor attribute back into alertListForm. --- Thanks Mick Knutson http://www.baselogic.com +001(805) 563-0666 Office +001 (708) 570-2772 Fax --- - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Invalid Class file Format
Hi, i'm just moving an app from struts 1.0x to 1.1: The App runs on weblogic 6.1: I'm developing on a windows box and deploy it to solaris: On windows everything runs fine, but on solaris i get lots of Invalid class file format - Exceptions from the Taglibs when I recompile my jsp's: error: Ungültiges Klassendateiformat: /home/bea/wlserver6.1/./config/mydomain/applications/dvrWebApp/WEB-INF/_tmp_war_myserver_myserver_dvrWebApp/WEB-INF/lib/1063628737543struts.jar(org/apache/struts/taglib/html/SubmitTag.class), wrong version: 46, expected 45 /home/bea/wlserver6.1/config/mydomain/applications/dvrWebApp/WEB-INF/_tmp_war_myserver_myserver_dvrWebApp/jsp_servlet/_htdocs/_redsys/_products/__kategorieNeu.java:81: Klasse org.apache.struts.taglib.html.SubmitTag nicht gefunden in type declaration. org.apache.struts.taglib.html.SubmitTag _html_submit0 = null; So, there seems to be just *one* version tick wrong: Does anyone know with which jdk-version struts is currently compiled?! And when this did change?! Unfortunately, upgrading the jdk on solaris is currently not an option, so I'm looking for a struts 1.1 compiled with an earlier jdk-version. Or does somebody have any other ideas?! desperately... stefan PS: I also tried to rebuild struts from the source, but There seems to be missing a class (or it has been moved from the struts.jar to somewhere else), as i get a ClassNotFoundException for org.apache.struts.util.PropertyMessageResourcesFactory... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Mapping/Path Question
No, I wouldn't necessarily use modules, I was just wondering because it looked like the action path that your app was looking for added the extra path names (/wireless/micro_browser). I think if you are using modules, the paths resolve themselves to be module relative instead of application relative. More or less guessing on that though. FYI, I do always use the slash in the beginning of my action attributes on my view pages. I didn't think that was optional. I believe the .do might be optional, but I always include that also. Sorry I couldn't be more help. Susan On 09/12/2003 04:58:28 PM Hunter Hillegas wrote: No, I am only using the default module in this web-app. Should I use a different module for the wireless part? Would that be the best way to handle it? Hunter From: Susan Bradeen [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] Date: Fri, 12 Sep 2003 16:40:27 -0400 To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Mapping/Path Question Hunter, Are you using a module for the wireless portion of your application? If so, then, I think, that the actions you specify in those pages will need to be defined in your struts-module-config.xml, instead of a base struts-config.xml. It kind of looks like the page in your /sample directory worked because it is in the default module, but the wireless one doesn't work because it is in a separate module. Maybe?? Susan Bradeen On 09/12/2003 03:29:01 PM Hunter Hillegas wrote: I gave that a try and ended up with identical results. Thanks for trying. Hunter From: Robert Taylor [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] Date: Fri, 12 Sep 2003 15:19:15 -0400 To: Struts Users Mailing List [EMAIL PROTECTED] Subject: RE: Mapping/Path Question Can you do something like this? html:form action=/PrepareSampleRequest html:hidden property=wireless/ /html:form robert -Original Message- From: Hunter Hillegas [mailto:[EMAIL PROTECTED] Sent: Friday, September 12, 2003 2:25 PM To: Struts List Subject: Mapping/Path Question Hello. We are adding a wireless portion to our site. The wireless pages live in a subdirectory: /wireless/micro_browser/sample Anyway, in one of the pages in that directory I tried to call an Action like this: FORM ACTION=PrepareSampleRequest.do?wireless=micro METHOD=POST This fails with the following error: 11:20:26,020 ERROR [RequestProcessor] Invalid path /wireless/micro_browser/PrepareSampleRequest was requested I'm a bit confused because I can call that same action from a file that lives in: /sample without any other path info (i.e. no /PrepareSampleRequest.do - no forward slash at the beginning). My action is defined as follows: action path=/PrepareSampleRequest name=sampleRequestBodyForm type=com.jacobstern.actions.sample.PrepareSampleRequestAction parameter=/sample/create_sample_request2.jsp scope=request validate=false/ So, I'm sure I'm doing something incorrectly... But I'm not sure what. I've experimented with a few different ideas. Can I set it up to work the way it is specified now in the pages? Any help is appreciated. Thanks, Hunter - 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] - 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]
DynaValidatorForm and Multi-page validation
Hi - I am having trouble with my DynaValidatorForm and Multi-page validation. It does not seem to utilize the page property. I tried putting in a page property but I get Struts errors. When I add the page property to the struts-config file for that form, and I add the page property as an integer, I get a Null pointer exception. When I put the page property as a string, I get a ClassCastException. No matter what I do, I can't get the page validation to work. Does anyone have a clue? Can anyone help me?? Thanks in advance, Natalie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validator-rules.xml -- required fields validation for multiples radios, checkboxes etc
Rob, Thanks for your response. I ended up with changing the validator-rules.xml file myself to add support for multiple radios, checkboxes and selections (just for the validateRequired(form) function) If you would like to post a BugZilla report and provide a patch against the nightly, that can be integarted into the validator code, that would be much appreciated ! Sounds good, I'll do that soon. Saul -Rob I checked the validator-rules.xml file in the latest nightly built (Sep 12), I noticed it added support for multiple radio buttons, but not yet for multiples checkboxes and selections. Thanks, Saul Use the nightly build of struts, this was fixed on Sept 9. Please let me know if it works for you. -Rob Hi, I have some problems validating multiple radio buttons and checkboxes, selections on the client side. Tracking down to the javascript code defined in validator-rules.xml, I found that the validateRequired(form) function doesn't deal with multiple checkboxes, selections at all. For multiples radios, checkboxes etc, the field.type = undefined. Can somebody explain why is this? Thanks, Saul Validator-rules.xml: - function validateRequired(form) { var isValid = true; var focusField = null; var i = 0; var fields = new Array(); oRequired = new required(); for (x in oRequired) { var field = form[oRequired[x][0]]; if (field.type == 'text' || field.type == 'textarea' || field.type == 'file' || field.type == 'select-one' || field.type == 'radio' || field.type == 'password') { var value = ''; // get field's value if (field.type == select-one) { var si = field.selectedIndex; if (si = 0) { value = field.options[si].value; } } else { value = field.value; } if (trim(value).length == 0) { if (i == 0) { focusField = field; } fields[i++] = oRequired[x][1]; isValid = false; } } } if (fields.length 0) { focusField.focus(); alert(fields.join('\n')); } return isValid; } - 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: Invalid Class file Format
Hi, considering the class file versions, 45 stands for JDK 1.0/1.1, 46 is 1.2/1.3 (and 48 is 1.4): http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#75 883 Seems your server still runs under JDK 1.1, or am I wrong? The Struts 1.1 binaries seem to be compiled under JDK 1.3: http://jakarta.apache.org/struts/userGuide/release-notes-1.1.html HTH, -- Chris (SCPJ2) - Original Message - From: Stefan Frank [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, September 15, 2003 2:38 PM Subject: Invalid Class file Format Hi, i'm just moving an app from struts 1.0x to 1.1: The App runs on weblogic 6.1: I'm developing on a windows box and deploy it to solaris: On windows everything runs fine, but on solaris i get lots of Invalid class file format - Exceptions from the Taglibs when I recompile my jsp's: error: Ungültiges Klassendateiformat: /home/bea/wlserver6.1/./config/mydomain/applications/dvrWebApp/WEB-INF/_tmp_ war_myserver_myserver_dvrWebApp/WEB-INF/lib/1063628737543struts.jar(org/apac he/struts/taglib/html/SubmitTag.class), wrong version: 46, expected 45 /home/bea/wlserver6.1/config/mydomain/applications/dvrWebApp/WEB-INF/_tmp_wa r_myserver_myserver_dvrWebApp/jsp_servlet/_htdocs/_redsys/_products/__katego rieNeu.java:81: Klasse org.apache.struts.taglib.html.SubmitTag nicht gefunden in type declaration. org.apache.struts.taglib.html.SubmitTag _html_submit0 = null; So, there seems to be just *one* version tick wrong: Does anyone know with which jdk-version struts is currently compiled?! And when this did change?! Unfortunately, upgrading the jdk on solaris is currently not an option, so I'm looking for a struts 1.1 compiled with an earlier jdk-version. Or does somebody have any other ideas?! desperately... stefan PS: I also tried to rebuild struts from the source, but There seems to be missing a class (or it has been moved from the struts.jar to somewhere else), as i get a ClassNotFoundException for org.apache.struts.util.PropertyMessageResourcesFactory... - 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 with logic:equal?
You have defined the user bean between the logic:equal tag this will visible if it is out of scope. Like If(something==true) { User userName = someUser; } if(something!=true){ userName } if you try to use user it is out of scope logic:equal name=elem property=status value=10 bean:define id=username name=UserContainer scope=session property=user.username / logic:equal name=elem property=caseworker value=%= (String) username % td class=text bean:write name=elem property=annCreated //td td class=text bean:write name=elem property=filnavn //td td class=text html:radio property=checked idName=elem value=annID//td /logic:equal logic:notEqual name=elem property=caseworker value=%= (String) username % td class=textdis bean:write name=elem property=annCreated //td Thanks Nazeer -Original Message- From: Bjørn T Johansen [mailto:[EMAIL PROTECTED] Sent: Sunday, September 14, 2003 7:46 AM To: Struts Users Mailing List Subject: Problem with logic:equal? I have this code in my jsp page: logic:iterate id=elem name=annList tr logic:equal name=elem property=status value=0 td class=text bean:write name=elem property=annCreated //td td class=text bean:write name=elem property=filnavn //td td class=text html:radio property=checked idName=elem value=annID//td /logic:equal logic:equal name=elem property=status value=10 bean:define id=username name=UserContainer scope=session property=user.username / logic:equal name=elem property=caseworker value=%= (String) username % td class=text bean:write name=elem property=annCreated //td td class=text bean:write name=elem property=filnavn //td td class=text html:radio property=checked idName=elem value=annID//td /logic:equal logic:notEqual name=elem property=caseworker value=%= (String) username % td class=textdis bean:write name=elem property=annCreated //td td class=textdis bean:write name=elem property=filnavn //td td class=textdis bean:write name=elem property=caseworker //td /logic:notEqual /logic:equal /tr /logic:iterate But this just gives me an error message telling me that cannot resolve symbol symbol : variable username But this variable has been defined, hasn't it?? Any suggestions? Regards, BTJ
Map backed action form
Hello, I have a problem with my map backed form. When I try to validate the form, when I try to retrieve value it throws a null pointer exception, as if the map was null. I am successful going through my jsp and populating the bean, so i am not sure what is going on. What might be the problem? form: private Map properties; public Map getProperties() { return this.properties; } /** Setter for property properties. * @param properties New value of property properties. * */ public void setProperties(Map properties) { this.properties = properties; } public void setValue(String key, Object value) { properties.put(key, value); } public Object getValue(String key) { return properties.get(key); } struts-config definitions form-bean name=registerUserForm type=com.blah.gum.forms.RegisterUserForm/ action path=/registerUser type=com.blah.gum.actions.RegisterUser name=registerUserForm scope=request input=new_register.jsp forward name=success path=/out.jsp/ /action
RE: Errors / Messages
I would like the action to perform (not fail as validator specifies) but give feedback to the user about the entered data. For example in certain fields you can use a table as a select but override the selection, and other input would be added to the selection. You would want to let the user know that the information was added to the allowed list. I am doing your other selection in the action class as well. My intermeditate solution, is to extend the ActionForm and add an informational message ActionMessages property and a special tag for displaying any pending informational messages. Edgar -Original Message- From: Max Cooper [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 5:38 AM To: Struts Users Mailing List Subject: Re: Errors / Messages Edgar, What is your aim in doing this? If there is a validation error, the Struts framework sends the user back to the input page to inform them of the problem, and possibly allow them to fix it and resubmit. If the request still gets passed to the action, the action will need to do conditional processing based on the presence of errors, and then it is unclear how control will pass back to Struts so that it can send the user back to the input page to inform them of what went wrong. I have sometimes thought about having the action produce a validation-style error if something goes wrong in processing the request, after which it could pass control back to the Struts framework to send the user back to the input page. You can of course add another forward or something, but it would be nice if you could just tell Struts more cleary that something went wrong and that Struts should send the user back to the input form (as it does with a validation error), but I am not sure if there is an elegant way to do that. This is distinct from your proposed flow, but it seems the same feature (tell Struts there was an error and user should be sent back to input form) could support both of our scenarios. What is the scenario you wish to support with the control flow that are looking for? -Max - Original Message - From: Edgar P Dollin [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, September 15, 2003 2:54 AM Subject: Errors / Messages In validate, if you add an error to the message list, validator returns without forwarding. Has anyone done anything with an alternate message file or prioritized messages, so you can add a message yet still forward. Thanks in advance. Edgar - 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]
Dynamic retrieval of properties from Message Resources Applicatio n.properties
Hi, Does anyone know ways to dynamically load application properties file so that we donot have to reload container when a change has been made in the properties file. I have seen the Message-Resources DB application (using OJB) by James Mitchell using which we can put the properties in a database and retrieve them . But It also needs the container to be reloaded when a change has been made. Please suggest some ideas or code which will help in creating an extension so that the properties can be loaded from database dynamically. Thanks Srikanth. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: error pages, actions, and tiles
Hi Susan, Are you certain that no exceptions are being logged for your setup? Note, it appears to work for me other than the exceptions that are logged upon every request. A few more things: I am able to reproduce the problem with the tiles-blank-struts1-1 example app. I have reproduced the problem with both the following Tomcat distributions (from Jbuilder 9): jakarta-tomcat-4.1.24-LE-jdk14 jakarta-tomcat-4.0.6-LE-jdk14 Are other people not forwarding to error pages to actions/tiles? Thanks, Dan -Original Message- From: Susan Bradeen Sent: Friday, September 12, 2003 4:02 PM To: Struts Users Mailing List Subject: RE: error pages, actions, and tiles Hi Dan, Did you get anywhere on this? I just put in a couple of error page definitions in my web.xml to see what happens, and it works ok for me. Here's what I have, basically just what you have: web.xml: error-page error-code404/error-code location/prompterrors.do/location /error-page error-page error-code400/error-code location/prompterrors.do/location /error-page struts-config.xml: action path=/prompterrors type=org.apache.struts.actions.ForwardAction parameter=.regError / tiles-defs.xml: definition name=.regError extends=.base put name=title value=Errors/ put name=content value=/forTesting/testError.jsp/ /definition Do you get the socket errors if you specify a straight JSP file, instead of a tile/action for the error page location attribute? I wonder if all web servers interpret the location attribute the same way. Susan On 09/12/2003 12:42:35 PM Dan Snider wrote: Sorry, I'm actually using the same technique for other errors. I wanted to give a representative case but accidentally grabbed the 400 error definition from struts-config.xml. The struts-config also contains: action type=org.apache.struts.actions.ForwardAction parameter=.error.404.page path=/error/404 / Dan -Original Message- From: Susan Bradeen [mailto:[EMAIL PROTECTED] Sent: Friday, September 12, 2003 12:25 PM To: Struts Users Mailing List Subject: Re: error pages, actions, and tiles First of all, unless they are email typos, you've got 404s and 400s in your definitions. Should the 400s be 404s? Susan Bradeen On 09/12/2003 11:41:49 AM Dan Snider wrote: Hello, I am using Struts 1.1 and Tiles and I would like to forward error-pages to a tile-composing action. web.xml: error-page error-code404/error-code location/error/404.do/location /error-page struts-config.xml: action type=org.apache.struts.actions.ForwardAction parameter=.error.400.page path=/error/400 / From a user standpoint, it appears works but I now get the following exceptions upon every request, valid or not. ErrorDispatcherValve[localhost]: Exception Processing ErrorPage[errorCode=404, location=/error/404.do] java.net.SocketException: Software caused connection abort: socket write error ... ErrorDispatcherValve[localhost]: Exception Processing ErrorPage[errorCode=404, location=/error/404.do] ErrorDispatcherValve[localhost]: Exception Processing ErrorPage[errorCode=404, location=/error/404.do] ... java.net.SocketException: Software caused connection abort: socket write error ... java.net.SocketException: Software caused connection abort: socket write error ... Any ideas? Thanks, Dan - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:errors tag..
Hi There, I am using html:errors\ tag at top of my page to display any validation errors when a form is submitted, but for some reason, I couldn't see any errors message even I have left some mandatory fields blank. I am not getting any errors in server log as well. I have added the validation logic in validate() method of ActionForm subclass. I think Struts adds ActionErrors object in the request\session scope with a know key, can anyone let me know the exaclt key name? What would be the best way test errors using Struts? thanks, Ritvik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Forwarding to a target page
Hi, I have a web page with 2 vertical frames. I have the following link in my left hand frame and I want the users to view the results in the right hand frame when they click on the link. td width=130 html:link action=Contacts.do?page=viewcontactlistbContact List/b/html:link /td Basically I want to do copy the below functionalitywith my target being the righframe. td width=130a href=/servlets/blotter/Contact?page=viewcontactlist target=rightframe class=linkboldContact List/a/td Is there any way I can do this uisng the struts taglibs? -- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Newbie looking for resources to learn
Hi, Where can I find resources(tutorials, ides, articles etc..) to learn? Thanks. Isaac
RE: Newbie looking for resources to learn
Here's an important resource, probably one of the most important of all: http://www.catb.org/~esr/faqs/smart-questions.html#intro -= J -Original Message- From: Isaac [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 9:46 AM To: [EMAIL PROTECTED] Subject: Newbie looking for resources to learn Hi, Where can I find resources(tutorials, ides, articles etc..) to learn? Thanks. Isaac - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie looking for resources to learn
Where can I find resources(tutorials, ides, articles etc..) to learn? I've found Google to be a pretty good resource. http://www.google.com/search?hl=enie=UTF-8oe=UTF-8q=Struts+TutorialbtnG= Google+Search -TPP - This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, retention, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message. Also, email is susceptible to data corruption, interception, tampering, unauthorized amendment and viruses. We only send and receive emails on the basis that we are not liable for any such corruption, interception, tampering, amendment or viruses or any consequence thereof. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie looking for resources to learn
garrgh! too slow tonight! You beat me to the draw James. ;- -Original Message- From: James Childers [mailto:[EMAIL PROTECTED] Sent: Monday, 15 September 2003 22:48 To: Struts Users Mailing List Subject: RE: Newbie looking for resources to learn Here's an important resource, probably one of the most important of all: http://www.catb.org/~esr/faqs/smart-questions.html#intro -= J -Original Message- From: Isaac [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 9:46 AM To: [EMAIL PROTECTED] Subject: Newbie looking for resources to learn Hi, Where can I find resources(tutorials, ides, articles etc..) to learn? Thanks. Isaac - 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: error pages, actions, and tiles
On 09/15/2003 10:16:50 AM Dan Snider wrote: Hi Susan, Are you certain that no exceptions are being logged for your setup? Note, it appears to work for me other than the exceptions that are logged upon every request. No, I am not getting any kind of socket errors, or any errors logged. A few more things: I am able to reproduce the problem with the tiles-blank-struts1-1 example app. Where did you get this app? I haven't got this one in my Struts 1.1 distribution. Susan I have reproduced the problem with both the following Tomcat distributions (from Jbuilder 9): jakarta-tomcat-4.1.24-LE-jdk14 jakarta-tomcat-4.0.6-LE-jdk14 Are other people not forwarding to error pages to actions/tiles? Thanks, Dan -Original Message- From: Susan Bradeen Sent: Friday, September 12, 2003 4:02 PM To: Struts Users Mailing List Subject: RE: error pages, actions, and tiles Hi Dan, Did you get anywhere on this? I just put in a couple of error page definitions in my web.xml to see what happens, and it works ok for me. Here's what I have, basically just what you have: web.xml: error-page error-code404/error-code location/prompterrors.do/location /error-page error-page error-code400/error-code location/prompterrors.do/location /error-page struts-config.xml: action path=/prompterrors type=org.apache.struts.actions.ForwardAction parameter=.regError / tiles-defs.xml: definition name=.regError extends=.base put name=title value=Errors/ put name=content value=/forTesting/testError.jsp/ /definition Do you get the socket errors if you specify a straight JSP file, instead of a tile/action for the error page location attribute? I wonder if all web servers interpret the location attribute the same way. Susan On 09/12/2003 12:42:35 PM Dan Snider wrote: Sorry, I'm actually using the same technique for other errors. I wanted to give a representative case but accidentally grabbed the 400 error definition from struts-config.xml. The struts-config also contains: action type=org.apache.struts.actions.ForwardAction parameter=.error.404.page path=/error/404 / Dan -Original Message- From: Susan Bradeen [mailto:[EMAIL PROTECTED] Sent: Friday, September 12, 2003 12:25 PM To: Struts Users Mailing List Subject: Re: error pages, actions, and tiles First of all, unless they are email typos, you've got 404s and 400s in your definitions. Should the 400s be 404s? Susan Bradeen On 09/12/2003 11:41:49 AM Dan Snider wrote: Hello, I am using Struts 1.1 and Tiles and I would like to forward error-pages to a tile-composing action. web.xml: error-page error-code404/error-code location/error/404.do/location /error-page struts-config.xml: action type=org.apache.struts.actions.ForwardAction parameter=.error.400.page path=/error/400 / From a user standpoint, it appears works but I now get the following exceptions upon every request, valid or not. ErrorDispatcherValve[localhost]: Exception Processing ErrorPage[errorCode=404, location=/error/404.do] java.net.SocketException: Software caused connection abort: socket write error ... ErrorDispatcherValve[localhost]: Exception Processing ErrorPage[errorCode=404, location=/error/404.do] ErrorDispatcherValve[localhost]: Exception Processing ErrorPage[errorCode=404, location=/error/404.do] ... java.net.SocketException: Software caused connection abort: socket write error ... java.net.SocketException: Software caused connection abort: socket write error ... Any ideas? Thanks, Dan - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
Re: Newbie looking for resources to learn
onjava.com is pretty good. --- Thanks Mick Knutson http://www.baselogic.com +001(805) 563-0666 Office +001 (708) 570-2772 Fax --- - Original Message - From: Isaac [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, September 15, 2003 7:46 AM Subject: Newbie looking for resources to learn Hi, Where can I find resources(tutorials, ides, articles etc..) to learn? Thanks. Isaac - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Forwarding to a target page
td width=130 html:link action=/Contacts target=rightframe styleClass=linkbold paramId=page paramName=targetActionbContact List/b/html:link /td Where targetAction exists in some scope and has a value of viewcontactlist. http://jakarta.apache.org/struts/userGuide/struts-html.html#link robert -Original Message- From: Mehran Zonouzi [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 10:39 AM To: [EMAIL PROTECTED] Subject: Forwarding to a target page Hi, I have a web page with 2 vertical frames. I have the following link in my left hand frame and I want the users to view the results in the right hand frame when they click on the link. td width=130 html:link action=Contacts.do?page=viewcontactlistbContact List/b/html:link /td Basically I want to do copy the below functionalitywith my target being the righframe. td width=130a href=/servlets/blotter/Contact?page=viewcontactlist target=rightframe class=linkboldContact List/a/td Is there any way I can do this uisng the struts taglibs? -- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Invalid Class file Format
Hi Christian, no, unfortunately not: System.getProperty(java.version): 1.3.1 System.getProperty(java.vendor): Sun Microsystems Inc. I'm currently trying to find out if bea somehow tweaked the magic - has anybody gotten struts 1.1 to run on weblogic 6.1 on solaris? (Solaris is important, as 1.1 runs on the windows-box without complaining. Looks like solaris has a different magic...) cheers Stefan Christian Bollmeyer (SCPJ2) wrote: Hi, considering the class file versions, 45 stands for JDK 1.0/1.1, 46 is 1.2/1.3 (and 48 is 1.4): http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#75 883 Seems your server still runs under JDK 1.1, or am I wrong? The Struts 1.1 binaries seem to be compiled under JDK 1.3: http://jakarta.apache.org/struts/userGuide/release-notes-1.1.html HTH, -- Chris (SCPJ2) - Original Message - From: Stefan Frank [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, September 15, 2003 2:38 PM Subject: Invalid Class file Format Hi, i'm just moving an app from struts 1.0x to 1.1: The App runs on weblogic 6.1: I'm developing on a windows box and deploy it to solaris: On windows everything runs fine, but on solaris i get lots of Invalid class file format - Exceptions from the Taglibs when I recompile my jsp's: error: Ungültiges Klassendateiformat: /home/bea/wlserver6.1/./config/mydomain/applications/dvrWebApp/WEB-INF/_tmp_ war_myserver_myserver_dvrWebApp/WEB-INF/lib/1063628737543struts.jar(org/apac he/struts/taglib/html/SubmitTag.class), wrong version: 46, expected 45 /home/bea/wlserver6.1/config/mydomain/applications/dvrWebApp/WEB-INF/_tmp_wa r_myserver_myserver_dvrWebApp/jsp_servlet/_htdocs/_redsys/_products/__katego rieNeu.java:81: Klasse org.apache.struts.taglib.html.SubmitTag nicht gefunden in type declaration. org.apache.struts.taglib.html.SubmitTag _html_submit0 = null; So, there seems to be just *one* version tick wrong: Does anyone know with which jdk-version struts is currently compiled?! And when this did change?! Unfortunately, upgrading the jdk on solaris is currently not an option, so I'm looking for a struts 1.1 compiled with an earlier jdk-version. Or does somebody have any other ideas?! desperately... stefan PS: I also tried to rebuild struts from the source, but There seems to be missing a class (or it has been moved from the struts.jar to somewhere else), as i get a ClassNotFoundException for org.apache.struts.util.PropertyMessageResourcesFactory... - 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: html:errors tag..
This is some code that I used in an actionForm. public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); if ((userId == null) || (userId.length() 1)) { errors.add(noUser, new ActionError (adresses.insertUser.noUser)); } return errors; } In the applicationResources.properties, you have to add the message : adresses.insertUser.noUser=You have to give a userId This should work. Why don't you try the validator framework. You don't have to create an ActionForm for each jsp you create. Koen Boutsen - Original Message - DATE: Mon, 15 Sep 2003 10:22:27 From: Ritvik [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: Hi There, I am using html:errors\ tag at top of my page to display any validation errors when a form is submitted, but for some reason, I couldn't see any errors message even I have left some mandatory fields blank. I am not getting any errors in server log as well. I have added the validation logic in validate() method of ActionForm subclass. I think Struts adds ActionErrors object in the request\session scope with a know key, can anyone let me know the exaclt key name? What would be the best way test errors using Struts? thanks, Ritvik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail! http://login.mail.lycos.com/r/referral?aid=27005 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie looking for resources to learn
As you've seen from other replies google can be a very useful resource - as can: http://marc.theaimsgroup.com/?l=struts-user Try some searches for various topics - I'd recommend the following one, particularly for a tutorial: http://marc.theaimsgroup.com/?l=struts-userm=106120528909583 Also, the struts website (which I presume you've seen as you've got as far as this list) also has links to lots of resources: http://jakarta.apache.org/struts/ (hint: try the learning link) Hue. -Original Message- From: Isaac [mailto:[EMAIL PROTECTED] Sent: 15 September 2003 15:46 To: [EMAIL PROTECTED] Subject: Newbie looking for resources to learn Hi, Where can I find resources(tutorials, ides, articles etc..) to learn? Thanks. Isaac --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.518 / Virus Database: 316 - Release Date: 11/09/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.518 / Virus Database: 316 - Release Date: 11/09/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re-directing to a non-Struts URL that requires extra parameters
We are working on a portal site that has integrated content management for admin users. We are trying to use Struts together with a portal framework... use the portal framework to deliver the pages for end users, and use the Struts framework to process our submit forms. So our interaction will be as follows: 1. User views a read-only page delivered by the portal framework (portal URL) with content on it. the User clicks an [Edit] link. 2. User views an edit page delivered by the portal framework (portal URL); the page contains a form defined by Struts tags. 3. User submits the form; this goes to a Struts action for processing (struts URL). 4. (if validation fails) user is returned to the form page with the validation message; the URL is the same struts URL as 3, which is fine. 5. (if validation succeeds) user returns to the read-only page. Here we want the user to go back to the URL in 1, which is a portal URL with request parameters. At this point, we want the user at a non-Struts URL so that they can copy and paste the URL to send to a non-admin user for viewing. I have the following sample set up in my struts-config: form-bean name=helloForm type=com.medtronic.sem.strutstest.HelloForm/ /form-beans action path=/hello type=com.medtronic.sem.strutstest.HelloAction name=helloForm scope=request input=/application?origin=titlebar.jspamp;event=bea.portal.framework.internal.portlet.editamp;pageid=homeamp;portletid=HelloStrutsamp;wfevent=null forward name=success path=/application?origin=titlebar.jspamp;event=bea.portal.framework.internal.portlet.uneditamp;pageid=homeamp;portletid=HelloStrutsamp;wfevent=null redirect=true/ forward name=failure path=/application?origin=titlebar.jspamp;event=bea.portal.framework.internal.portlet.editamp;pageid=homeamp;portletid=HelloStrutsamp;wfevent=null redirect=true/ /action This works as far as getting the user back to a non-Struts URL, but I really want to take that base success URL and tack on some additional parameters before we re-direct( such as category=HRitemid=9874324934). I have searched the list archives, but didn't find much on this. Some people had the Action class build the new URL with the request parameters, but others objected that this broke proper separation - the Action now knows about the View, and that's bad. Can anyone suggest a proper approach for this within Struts? Is it more proper to create our own ActionForward that can re-build the request URL based on session information, and then do the re-direct? Is what we are trying to do currently beyond the scope of what you can do properly using Struts? Thanks much, Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie looking for resources to learn
I have been reading Programming Jakarta Struts from O'Reilly to ramp up, and it's fantastic IMHO... Scott -Original Message- From: Hue Holleran [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 10:07 AM To: Struts Users Mailing List Subject: RE: Newbie looking for resources to learn As you've seen from other replies google can be a very useful resource - as can: http://marc.theaimsgroup.com/?l=struts-user Try some searches for various topics - I'd recommend the following one, particularly for a tutorial: http://marc.theaimsgroup.com/?l=struts-userm=106120528909583 Also, the struts website (which I presume you've seen as you've got as far as this list) also has links to lots of resources: http://jakarta.apache.org/struts/ (hint: try the learning link) Hue. -Original Message- From: Isaac [mailto:[EMAIL PROTECTED] Sent: 15 September 2003 15:46 To: [EMAIL PROTECTED] Subject: Newbie looking for resources to learn Hi, Where can I find resources(tutorials, ides, articles etc..) to learn? Thanks. Isaac --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.518 / Virus Database: 316 - Release Date: 11/09/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.518 / Virus Database: 316 - Release Date: 11/09/2003 - 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]
Desing Question
Hello, I have a separate Data Object and Action Form bean. In my form beans have a attribute which corresponds to Data Object. And had written a separate setter and getter methods for each attribute of Data object and some addition required for working of struts. Like this. e.g. public class CompanyForm extends ActionForm{ /* * CompanyInfo object */ private CompanyInfo companyInfo; public String String getCompanyName(){ return companyInfo.getCompanyName(); } public void setCompanyName(String str) { this.companyInfo.setCompanyName(str); } ... Now my question are 1. Is this a good design. 2. Do my Data object also have to implement java.io.Serializable interface so that they can be stored in session scope. I am asking question 2 since some times i get the error saying CompanyInfo is not serializable. To remove this error i have to delete work directory from tomcat installation and restart the tomcat server. I thaught that i am getting this error since because data object CompanyInfo is not implementating java.io.Serializable. Please advice. Thanks and Regards Deepak. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie looking for resources to learn
Struts in Action is another great one. (Do I get a signed copy now Ted??? ;- ) -Original Message- From: Mark, Scott [mailto:[EMAIL PROTECTED] Sent: Monday, 15 September 2003 23:10 To: Struts Users Mailing List Subject: RE: Newbie looking for resources to learn I have been reading Programming Jakarta Struts from O'Reilly to ramp up, and it's fantastic IMHO... Scott -Original Message- From: Hue Holleran [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 10:07 AM To: Struts Users Mailing List Subject: RE: Newbie looking for resources to learn As you've seen from other replies google can be a very useful resource - as can: http://marc.theaimsgroup.com/?l=struts-user Try some searches for various topics - I'd recommend the following one, particularly for a tutorial: http://marc.theaimsgroup.com/?l=struts-userm=106120528909583 Also, the struts website (which I presume you've seen as you've got as far as this list) also has links to lots of resources: http://jakarta.apache.org/struts/ (hint: try the learning link) Hue. -Original Message- From: Isaac [mailto:[EMAIL PROTECTED] Sent: 15 September 2003 15:46 To: [EMAIL PROTECTED] Subject: Newbie looking for resources to learn Hi, Where can I find resources(tutorials, ides, articles etc..) to learn? Thanks. Isaac --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.518 / Virus Database: 316 - Release Date: 11/09/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.518 / Virus Database: 316 - Release Date: 11/09/2003 - 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]
html:select and Validation with IndexedPropertyList
I am having a problem with the Validator. I am not getting my messages back when I have a List of html:selects. The first error message is at property[0].message, but it does not show up for the next select boxes. Any thoughts? jsp: logic-el:iterate id=accumulationList name=depletionPool property=accumulationList indexId=id tr td c:out value=${accumulationList.depletionRateTypeDescription}/ /td td html-el:select name=accumulationList property=depletionLimit indexed=true html-el:option value=nbsp;/html-el:option html-el:option value=Y Yes/html-el:option html-el:option value=NNo/html-el:option /html-el:select br/ logic-el:messagesPresent html-el:errors property=accumulationList[${id}].depletionLimit / /logic-el:messagesPresent /td td html-el:text name=accumulationList property=leaseAmount indexed=true/ br/ logic-el:messagesPresent html-el:errors property=accumulationList[${id}].leaseAmount / /logic-el:messagesPresent /td c:if test=${depletionPool.depletionPool.depletionPoolId ne 0} td c:out value=${accumulationList.leaseDepletion}/ /td /c:if /tr /logic-el:iterate Validator: form name=depletionPool field property=depletionPool.office depends=required arg0 key=ngtsCommon.Office/ /field field property=depletionPool.depletionPool depends=required arg0 key=ngtsCommon.DepletionPool/ /field field property=depletionPool.description depends=required,maxlength var var-namemaxlength/var-name var-value${descMaxLen}/var-value /var arg0 key=ngtsCommon.Description/ arg1 name=maxlength key=${var:maxlength} resource=false/ /field field property=depletionLimit indexedListProperty=accumulationList depends=required arg0 key=ngtsCommon.DepletionLimit/ /field field property=leaseAmount indexedListProperty=accumulationList depends=required,maxlength,double,doubleGreaterThan var var-namemaxlength/var-name var-value12/var-value /var var var-namemin/var-name var-value0/var-value /var arg0 key=ngtsCommon.LeaseAmount/ arg1 name=maxlength key=${var:maxlength} resource=false/ arg1 name=doubleGreaterThan key=${var:min} resource=false / /field /form - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Forwarding to a target page
What exactly does this mean? Where targetAction exists in some scope and has a value of viewcontactlist. -- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:errors tag..
On Monday, September 15, 2003 at 3:22:27 PM, Ritvik wrote: R Hi There, R I am using html:errors\ tag at top of my page to display any R validation errors when a form is submitted, but for some reason, I R couldn't see any errors message even I have left some mandatory fields R blank. I am not getting any errors in server log as well. R I have added the validation logic in validate() method of ActionForm R subclass. I think Struts adds ActionErrors object in the request\session R scope with a know key, can anyone let me know the exaclt key name? Are you sure you are actually calling the validate() method? Either validate=true in the action definition or call the validate() method explicitly in the execute() method of the action as follows: errors = myForm.validate(mapping, request); // see if we found any validation errors if ( ! errors.isEmpty()) { saveErrors(request, errors); return (new ActionForward(mapping.getInput())); } // end of if () -- Louise Pryor http://www.louisepryor.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ActionForm validate() - How to get ServletContext from HttpSessio n in J2EE 1.2
Hi, I am using Weblogic 5.1 and if I'm not wrong it is implementing J2EE 1.2, in which the HttpSession interface does not specify the getServletContext() method. I need to get to the application context via : request - session - application. My issue is the following : In my ActionForm validate() method I need to access an object saved to the Application context; however, I can only get access to the Application context by means of : request.getSession().getServletContext().getAttribute(myAttributeName); Since the ActionForm validate method is inherited and the signature is fixed to public ActionErrors validate(ActionMapping mapping, javax.servlet.http.HttpServletRequest request), do I have any other solutions to this problem ? Thanks, Henrique - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Displaying Errors in JSP !!
Hi, I am new to Struts and I am using Struts1.1 and my question is How to display an Error Message in my Login JSP (Which is having two fields 1. Login ID 2. Password) So When User enters LoginID and incorrect password ., I should display a message in my JSP something like The password you entered is invalid. Please try again... So pl. send me all possible solutions.. Cheer's Dhanu.
RE: Remember menu node
Ted, Thanks for your reply but I am still confused about how I can store information about which node of my menu was expanded and which node was contracted in a menuBean. I am not using struts-menu.tld, do I need to use it? Thanks again. -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED] Sent: Sunday, September 14, 2003 7:04 PM To: Struts Users Mailing List Subject: Re: Remember menu node With an web application, the only place we have to store state is the request and the session, or some external device, like a database. So for something like this, you would probably store the object that represents the menu state in the client's session. request.getSession().setAttribute(menuBean,menuBean); and then look for it before displaying a menu menuBean = request.getSession().getAttribute(menuBean); if (null==menuBean) menuBean = new MenuBean(); -Ted. Naresh Chapani (Sympatico) wrote: I am new to struts. I am using tiles and I am creating dynamic side menu using JavaBaen. When I click a link in side menu it expands and displays link below it. Then I clicks the link which will display the contents in body area but my side menu is redisplayed as original and the link which I expanded is contracted automatically. Is there any mechanism through which the system can remember the status of side menu? TIA Naresh -- Ted Husted, Junit in Action - http://www.manning.com/massol/, Struts in Action - http://husted.com/struts/book.html, JSP Site Design - http://www.amazon.com/exec/obidos/ISBN=1861005512. - 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]
Tiles and Struts.
Hello, We are using struts and tiles for view component of our application. We are facing the problem of setting the title for the jsp. The title has to be taken from the properties file and it depends upon the body of the tiles. Any pointer how to do this. my jsp file is as follows. %@ taglib uri=/tags/struts-tiles prefix=tiles % tiles:insert page=../common/layout.jsp flush=true tiles:put name=header value=../common/header.jsp / tiles:put name=leftmenu value=../common/globalleftmenu.jsp / tiles:put name=body-content value=../globaladmin/gblTechnologyBody.jsp / tiles:put name=footer value=../common/footer.jsp / /tiles:insert I am setting the tile in gblTechnologyBody.jsp file. It works fine when i have html head in all the jsp above. But if i remove html head tag from the jsp it does not work. I am removing the HTML head tag since when i do view source from the it i get 5 different html head and body tags. 4 for the jsp above and one for the layout.jsp. Pl. advice Thanks and Regards Deepak. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Displaying Errors in JSP !!
Hi There, Please have a look at html:errors tag posting earlier today.. There are couple of responses th that thread. They will help you. Ritvik Dhanunjaya Gotur wrote: Hi, I am new to Struts and I am using Struts1.1 and my question is How to display an Error Message in my Login JSP (Which is having two fields 1. Login ID 2. Password) So When User enters LoginID and incorrect password ., I should display a message in my JSP something like The password you entered is invalid. Please try again... So pl. send me all possible solutions.. Cheer's Dhanu. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Forwarding to a target page
I had posted the following as a solution for you: td width=130 html:link action=/Contacts target=rightframe styleClass=linkbold paramId=page paramName=targetActionbContact List/b/html:link /td This should render as something like the following: td width=130 a href=/Contacts.do?page=viewcontactlist target=rightframe class=linkboldbContact List/b/a /td What exactly does this mean? Where targetAction exists in some scope and has a value of viewcontactlist. This means that there exists some value under the name of targetAction in some scope (request, page, session, or application) equal to that of viewcontactlist. When the html:link .../ attempts to render itself it will look for an attribute named targetAction defined in some scope and retrieve its value. I just made targetAction up. You could call it anything. robert -Original Message- From: Mehran Zonouzi [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 11:25 AM To: [EMAIL PROTECTED] Subject: Re: Forwarding to a target page What exactly does this mean? Where targetAction exists in some scope and has a value of viewcontactlist. -- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
where I put my property files?
Hi all, Where I have to put property files? I am using Tomcat and Struts. I suppose I have to put them in WEB-INF directory, but my application cannot find them. Maybe I have to add something in struts-config.xml Could you help me, please? _ Mariano García Ingeniero de Sistemas Optiva Media Viriato,25 - 28010 Madrid - España t. +34 91 445 96 95 m. +34 651 03 33 86 © This message is printed on 100% recycled electrons. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Passing variables for logic:iterate
Ok, this is probably a dumb questio, but here it goes... I am trying to iterate over a portion of a list. I have calculated the portion (the offset and length) in my action. I have two entries in my DynaValidatorForm: form-property name=pageOffset type=java.lang.String/ form-property name=pageLength type=java.lang.String/ And I am doing a myform.set(pageOffset, String.valueOf(myCalcOffset)); etc. The iterate is: logic:iterate id=item name=bfData type=...lc.web.dto.BfFullEntryData offset=pageOffset length=pageLength indexId=index It just plain doesn't work. If I substitute something like 5 for pageOffset or pageLength, it works like a champ. What am I missing? It's got to be something simple... Thanks, /greg -- Gregory F. March-=-http://www.gfm.net:81/~march-=-AIM:GfmNet - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Desing Question
That's a subjective question. I can only offer my opinion. I usually have my forms only contain Strings. I do this because it gives me more flexibility for validation. It also offers an additional layer of abstraction which reduces the coupling between my business tier and presentation tier. I'll use BeanUtils.describe() and BeanUtils.populate() to convert data from my Action forms to the appropriate data transfer object (DTO). Do your Data objects have to implement Serializable. Well, yes, if you don't want the exception to be thrown and yes if you want their state to be saved. robert -Original Message- From: deepaksawdekar [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 11:12 AM To: Struts Users Mailing List Subject: Desing Question Hello, I have a separate Data Object and Action Form bean. In my form beans have a attribute which corresponds to Data Object. And had written a separate setter and getter methods for each attribute of Data object and some addition required for working of struts. Like this. e.g. public class CompanyForm extends ActionForm{ /* * CompanyInfo object */ private CompanyInfo companyInfo; public String String getCompanyName(){ return companyInfo.getCompanyName(); } public void setCompanyName(String str) { this.companyInfo.setCompanyName(str); } ... Now my question are 1. Is this a good design. 2. Do my Data object also have to implement java.io.Serializable interface so that they can be stored in session scope. I am asking question 2 since some times i get the error saying CompanyInfo is not serializable. To remove this error i have to delete work directory from tomcat installation and restart the tomcat server. I thaught that i am getting this error since because data object CompanyInfo is not implementating java.io.Serializable. Please advice. Thanks and Regards Deepak. - 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: Displaying Errors in JSP !!
Hi Rthvik, Thanx ..and is it possible to do the same thing with validator.xml Cheer's Dhanu. - Original Message - From: Ritvik [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, September 15, 2003 9:20 PM Subject: Re: Displaying Errors in JSP !! Hi There, Please have a look at html:errors tag posting earlier today.. There are couple of responses th that thread. They will help you. Ritvik Dhanunjaya Gotur wrote: Hi, I am new to Struts and I am using Struts1.1 and my question is How to display an Error Message in my Login JSP (Which is having two fields 1. Login ID 2. Password) So When User enters LoginID and incorrect password ., I should display a message in my JSP something like The password you entered is invalid. Please try again... So pl. send me all possible solutions.. Cheer's Dhanu. - 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: where I put my property files?
Mariano wrote: Where I have to put property files? I am using Tomcat and Struts. I suppose I have to put them in WEB-INF directory, but my application cannot find them. Maybe I have to add something in struts-config.xml Try putting it in WEB-INF/classes. It needs to be on the classpath. Take a look at the struts-example webapp to see where the .properties file is and how it's configured. -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University, PA, IRM - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tiles and Struts.
Tiles should be cumulative in that you shouldn't repeat HTML,BODY,etc. tags in each one. Only the outermost. You might consider using a Tiles controller to selectively choose the title, the controller would be called before any other tiles are called if you define it at the definition level. -Original Message- From: deepaksawdekar [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 11:45 AM To: Struts Users Mailing List Subject: Tiles and Struts. Hello, We are using struts and tiles for view component of our application. We are facing the problem of setting the title for the jsp. The title has to be taken from the properties file and it depends upon the body of the tiles. Any pointer how to do this. my jsp file is as follows. %@ taglib uri=/tags/struts-tiles prefix=tiles % tiles:insert page=../common/layout.jsp flush=true tiles:put name=header value=../common/header.jsp / tiles:put name=leftmenu value=../common/globalleftmenu.jsp / tiles:put name=body-content value=../globaladmin/gblTechnologyBody.jsp / tiles:put name=footer value=../common/footer.jsp / /tiles:insert I am setting the tile in gblTechnologyBody.jsp file. It works fine when i have html head in all the jsp above. But if i remove html head tag from the jsp it does not work. I am removing the HTML head tag since when i do view source from the it i get 5 different html head and body tags. 4 for the jsp above and one for the layout.jsp. Pl. advice Thanks and Regards Deepak. - 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: Passing variables for logic:iterate
I don't believe that logic:iterate .../ is smart enough to know that if the value for the offset or length attribute is not an integer then attempt to find the named value in all scopes. You can do something like this: bean:define id=pageOffset name=formName property=pageOffset/ bean:define id=pageLength name=formName property=pageLength/ logic:iterate id=item name=bfData type=...lc.web.dto.BfFullEntryData offset=%=pageOffset% length=%=pageLength% indexId=index Or you could use Struts-EL which provides a JSTL like syntax. robert -Original Message- From: Gregory F. March [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 12:00 PM To: [EMAIL PROTECTED] Subject: Passing variables for logic:iterate Ok, this is probably a dumb questio, but here it goes... I am trying to iterate over a portion of a list. I have calculated the portion (the offset and length) in my action. I have two entries in my DynaValidatorForm: form-property name=pageOffset type=java.lang.String/ form-property name=pageLength type=java.lang.String/ And I am doing a myform.set(pageOffset, String.valueOf(myCalcOffset)); etc. The iterate is: logic:iterate id=item name=bfData type=...lc.web.dto.BfFullEntryData offset=pageOffset length=pageLength indexId=index It just plain doesn't work. If I substitute something like 5 for pageOffset or pageLength, it works like a champ. What am I missing? It's got to be something simple... Thanks, /greg -- Gregory F. March-=-http://www.gfm.net:81/~march-=- AIM:GfmNet - 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: Passing variables for logic:iterate
1st, Thank you, I didn't realize the logic:Iterate tag had those two properties, so you've indirectly saved me some effort. 2nd, After looking at the source code for the iterate tag, it looks like it tries to look up those two values straight out of the pageContext. This would imply to me, that it doesn't look up the property on the form as it appears you want it to do. (i.e. if you do a request.setParameter(pageOffset,5) in your Action Class) or use a html:hidden property=pageOffset/ tag on your jsp page, it should work correctly. I think both ways are valid, but my gut is that the way you where going at it is the way anybody unfamiliar with the tag would try to use it. Perhaps this is a candidate for refactoring, I'd personally like a way to choose either way. It just seems bad practice to have one field be sucked from the bean, and two others be read from the page context (and it appears to be a simple 2 line fix). -Original Message- From: Gregory F. March [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 12:00 PM To: [EMAIL PROTECTED] Subject: Passing variables for logic:iterate Ok, this is probably a dumb questio, but here it goes... I am trying to iterate over a portion of a list. I have calculated the portion (the offset and length) in my action. I have two entries in my DynaValidatorForm: form-property name=pageOffset type=java.lang.String/ form-property name=pageLength type=java.lang.String/ And I am doing a myform.set(pageOffset, String.valueOf(myCalcOffset)); etc. The iterate is: logic:iterate id=item name=bfData type=...lc.web.dto.BfFullEntryData offset=pageOffset length=pageLength indexId=index It just plain doesn't work. If I substitute something like 5 for pageOffset or pageLength, it works like a champ. What am I missing? It's got to be something simple... Thanks, /greg -- Gregory F. March-=-http://www.gfm.net:81/~march-=-AIM:GfmNet - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message and its contents (to include attachments) are the property of Kmart Corporation (Kmart) and may contain confidential and proprietary information. You are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on information contained herein is strictly prohibited. Unauthorized use of information contained herein may subject you to civil and criminal prosecution and penalties. If you are not the intended recipient, you should delete this message immediately. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
One form, multiple JSPs, multiple validations
Good afternoon helpers, I've started a new application using struts 1.1 and I'm having some problems with some new concepts. I want to use XML form validation (DynaValidatorForm) using validator-rules.xml and my validaton.xml. Right now my application is working fine. Now I want to use different validation rules for the same form, accross multiple JSPs. For example: - TestForm is a DynaValidatorForm String name String address - test1.jsp I want to show one text box to fill the name property: (...) html:text property=name / (...) - test2.jsp I want to show one text box to fill the address property: (...) html:text property=address / (...) - struts-config.xml (...) form-beans form-bean name=testForm type=org.apache.struts.validator.DynaValidatorForm form-property name=name type=java.lang.String/ form-property name=address type=java.lang.String/ /form-bean /form-beans (...) - validaton.xml (...) formset form name=logonForm field property=username depends=required arg0 key=prompt.username/ /field field property=address depends=required arg0 key=prompt.address/ /field /form /formset (...) Now, I run http://localhost/app/test1.jsp and I fill in my name property. Then I want my app to validate only the name property. Then I forward to test2.jsp, fill the address property and now I want to validate only the address property. How can I do this? The problem is, what identifies a rule in validation.xml is the form name. I could define different names for my form in the struts-config.xml but imagine if I had 10 JSPs for each form. Thanks in advance Rben Carvalho
RE: Passing variables for logic:iterate
Damn! I hate being lazy. Thanks Mike for correcting my sub-par answer. I should have looked at the source before responding. robert -Original Message- From: Mainguy, Mike [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 12:26 PM To: 'Struts Users Mailing List' Subject: RE: Passing variables for logic:iterate 1st, Thank you, I didn't realize the logic:Iterate tag had those two properties, so you've indirectly saved me some effort. 2nd, After looking at the source code for the iterate tag, it looks like it tries to look up those two values straight out of the pageContext. This would imply to me, that it doesn't look up the property on the form as it appears you want it to do. (i.e. if you do a request.setParameter(pageOffset,5) in your Action Class) or use a html:hidden property=pageOffset/ tag on your jsp page, it should work correctly. I think both ways are valid, but my gut is that the way you where going at it is the way anybody unfamiliar with the tag would try to use it. Perhaps this is a candidate for refactoring, I'd personally like a way to choose either way. It just seems bad practice to have one field be sucked from the bean, and two others be read from the page context (and it appears to be a simple 2 line fix). -Original Message- From: Gregory F. March [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 12:00 PM To: [EMAIL PROTECTED] Subject: Passing variables for logic:iterate Ok, this is probably a dumb questio, but here it goes... I am trying to iterate over a portion of a list. I have calculated the portion (the offset and length) in my action. I have two entries in my DynaValidatorForm: form-property name=pageOffset type=java.lang.String/ form-property name=pageLength type=java.lang.String/ And I am doing a myform.set(pageOffset, String.valueOf(myCalcOffset)); etc. The iterate is: logic:iterate id=item name=bfData type=...lc.web.dto.BfFullEntryData offset=pageOffset length=pageLength indexId=index It just plain doesn't work. If I substitute something like 5 for pageOffset or pageLength, it works like a champ. What am I missing? It's got to be something simple... Thanks, /greg -- Gregory F. March-=-http://www.gfm.net:81/~march-=- AIM:GfmNet - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message and its contents (to include attachments) are the property of Kmart Corporation (Kmart) and may contain confidential and proprietary information. You are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on information contained herein is strictly prohibited. Unauthorized use of information contained herein may subject you to civil and criminal prosecution and penalties. If you are not the intended recipient, you should delete this message 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]
Image half loaded?
Anyone having the same problem? My images are cut off vertically sometimes... Thanks! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: java.lang.ArrayIndexOutOfBoundsException
The exception is occurring when the struts preprocessor tries to populate your form bean with request parameters. I expect you have indexed properties and you have not initialized your form bean with an array to accept them. Adam On 09/15/2003 02:04 PM Bj?rn T Johansen wrote: I have a jsp page that is using nested:iterate to show a list of records, based on some input on the same page. The first time I press the submit button to get the records, everything works like it should. But if I try to get the records one more time, I get this exception: javax.servlet.ServletException: BeanUtils.populate at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1254) -- struts 1.1 + tomcat 4.1.27 + java 1.4.2 Linux 2.4.20 RH9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Image half loaded?
I have a similar problem. This one class of mine doesn't work sometimes. From: Yansheng Lin [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: Image half loaded? Date: Mon, 15 Sep 2003 11:03:41 -0600 Anyone having the same problem? My images are cut off vertically sometimes... Thanks! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Use custom emotions -- try MSN Messenger 6.0! http://www.msnmessenger-download.com/tracking/reach_emoticon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Image half loaded?
This is not a Struts issue, but I've also had similar problems with images getting corrupted on occasion when I use Tomcat. I don't know the cause or fix, but thought I'd just mention it. -- James Mitchell Software Engineer / Struts Evangelist http://www.struts-atlanta.org 678.910.8017 AIM:jmitchtx -Original Message- From: Yansheng Lin [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 1:04 PM To: 'Struts Users Mailing List' Subject: Image half loaded? Anyone having the same problem? My images are cut off vertically sometimes... 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: Passing variables for logic:iterate
On Sep 15, 2003, Mainguy, Mike [EMAIL PROTECTED] wrote: |1st, Thank you, I didn't realize the logic:Iterate tag had those two |properties, so you've indirectly saved me some effort. : Thanks for the answers... As a first go-round, I'm trying the bean:define suggestion from Robert. On (I believe) the logic:iterate tag, I am getting: [Exception in:/bf/search/results.jsp] java.lang.String and I can't figure out why. How does one go about debugging this kind of thing? Thanks! /greg -- Gregory F. March-=-http://www.gfm.net:81/~march-=-AIM:GfmNet - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: sslext can only get it to post
On Sun, 14 Sep 2003, Max Cooper wrote: Some design changes are needed to make the switch to the https port in what I consider to be an acceptable manner. One avenue to explore is using one particular capability of container managed security, and declare a security constraint requiring SSL on a particular request. Something like this: security-constraint web-resource-collection web-resource-nameCheckout Section/web-resource-name description The set of URL patterns for requests that must be submitted via SSL. In order to avoid sending confidential data unencrypted, these patterns MUST include the page that renders the form to be submitted that contains that confidential data. /description !-- URL pattern for the form containing the credit card number -- url-pattern/checkout_form.jsp/url-pattern !-- URL pattern for the buy it submit button -- url-pattern/buy.do/url-pattern /web-resource-collection user-data-constraint transport-guaranteeCONFIDENTIAL/transport-guarantee /user-data-constraint /security-constraint If you do this, the container will switch to HTTPS for you before the checkout form is rendered. Hence, the ultimate submit of that form will be done over SSL. It's up to the container to figure out what the correct SSL port number is (in Tomcat, you configure this with the redirectPort attribute on a Connector element; the default configuration for non-SSL on port 8080 redirects to SSL on port 8443). Note that, because there is no auth-constraint here, this particular security constraint does not require you to use container managed security for authentication -- it's only being used to do the redirect to SSL trick for you. Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ActionForm validate() - How to get ServletContext from HttpSessio n in J2EE 1.2
On Mon, 15 Sep 2003, Chang, Henrique wrote: Date: Mon, 15 Sep 2003 11:32:38 -0400 From: Chang, Henrique [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: ActionForm validate() - How to get ServletContext from HttpSessio n in J2EE 1.2 Hi, I am using Weblogic 5.1 and if I'm not wrong it is implementing J2EE 1.2, in which the HttpSession interface does not specify the getServletContext() method. I need to get to the application context via : request - session - application. My issue is the following : In my ActionForm validate() method I need to access an object saved to the Application context; however, I can only get access to the Application context by means of : request.getSession().getServletContext().getAttribute(myAttributeName); Since the ActionForm validate method is inherited and the signature is fixed to public ActionErrors validate(ActionMapping mapping, javax.servlet.http.HttpServletRequest request), do I have any other solutions to this problem ? ActionForm has a getServlet() method, so you can call getServlet().getServletContext().getAttribute(myAttributeName); in a validate() method. Thanks, Henrique Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Application.properties
Hi, Does anyone know ways to dynamically load application properties file so that we donot have to reload container when a change has been made in the properties file. I have seen the Message-Resources DB application (using OJB) by James Mitchell using which we can put the properties in a database and retrieve them . But It also needs the container to be reloaded when a change has been made. Please suggest some ideas or code which will help in creating an extension so that the properties can be loaded from database dynamically. Thanks Srikanth. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Application.properties
Please suggest some ideas or code which will help in creating an extension so that the properties can be loaded from database dynamically. Extend the message resources class you're currently using and implement a reload() (or whatever) method in your extended class. Call the reload() method when appropriate. -TPP - This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, retention, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message. Also, email is susceptible to data corruption, interception, tampering, unauthorized amendment and viruses. We only send and receive emails on the basis that we are not liable for any such corruption, interception, tampering, amendment or viruses or any consequence thereof. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Image half loaded?
No, it's not a Struts issue. I almost cancelled the msg while I was posting it, but thought would mention it here anyways. Should I try Tomcat mailing list? Tomcat somehow displays images 'over-eagerly', maybe because image is binary data and contains a terminating charater or some other weird characters that Tomcat couldn't handle correctly?? It's no biggie though since all you need is to refresh the page. -Original Message- From: James [mailto:[EMAIL PROTECTED] Sent: September 15, 2003 11:35 AM To: 'Struts Users Mailing List' Subject: RE: Image half loaded? This is not a Struts issue, but I've also had similar problems with images getting corrupted on occasion when I use Tomcat. I don't know the cause or fix, but thought I'd just mention it. -- James Mitchell Software Engineer / Struts Evangelist http://www.struts-atlanta.org 678.910.8017 AIM:jmitchtx -Original Message- From: Yansheng Lin [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 1:04 PM To: 'Struts Users Mailing List' Subject: Image half loaded? Anyone having the same problem? My images are cut off vertically sometimes... 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Application.properties
That's one way to do it. Although doing so will create a compile-time dependency on using that class (whether you actually use it or not). By default, the Struts MessageResources API does not allow for reloading and given the nature of the implementation. Since the returned messages from your subclass are cached, you must clear the (cached) map of formatted messages with each call to your implementation's getMessage method or the MessageResources won't bother to call your method again (until you reload the app). This was a very frustrating feature that I had to overcome with my DBMessageResources implementation and one of the reasons I chose OJB for the underlying data access (configurable caching, etc). -- James Mitchell Software Engineer / Struts Evangelist http://www.struts-atlanta.org 678.910.8017 AIM:jmitchtx -Original Message- From: Paananen, Tero [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 1:49 PM To: 'Struts Users Mailing List' Subject: RE: Application.properties Please suggest some ideas or code which will help in creating an extension so that the properties can be loaded from database dynamically. Extend the message resources class you're currently using and implement a reload() (or whatever) method in your extended class. Call the reload() method when appropriate. -TPP - This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, retention, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message. Also, email is susceptible to data corruption, interception, tampering, unauthorized amendment and viruses. We only send and receive emails on the basis that we are not liable for any such corruption, interception, tampering, amendment or viruses or any consequence thereof. - 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: Invalid Class file Format
Am Montag, 15. September 2003 17:03 schrieb Stefan Frank: Hi Christian, Hi Stefan, no, unfortunately not: System.getProperty(java.version): 1.3.1 System.getProperty(java.vendor): Sun Microsystems Inc. Now this is interesting. Still, obviously the JSP compiler can't cope with Platform 2 files, though. I don't know anything about the BEA server, but I remember having a similar problem when upgrading the Oracle iAS to JDK 1.4 (with class file versions of 48.0 instead of 46). Finally, the culprit proved to be tools.jar shipped with the default installation which was a 1.3 version. The solution was to replace the tools.jar shipped with iAS 9i with the one from the JDK we used for development (Sun 1.4.1_02). Then, it might well be that the BEA server get ships with the correct tools.jar already, but the class loader instantiates a different version first, so I'd check the CLASSPATH, too. It *might* be that an 'old' implementation of the JSP compiler classes get loaded first. I'm currently trying to find out if bea somehow tweaked the magic - has anybody gotten struts 1.1 to run on weblogic 6.1 on solaris? (Solaris is important, as 1.1 runs on the windows-box without complaining. Looks like solaris has a different magic...) Though I have only limited experiences with Solaris, that's still a Sun OS and should adhere the standards even better than others in case of doubt. BTW, the aforementioned iAS installation runs under Linux, so it's not really too far from the spot. BTW - want to know I found it all out? Well, finally I remembered that Oracle had bought the iAS sources from Orion (after their first attempt in this direction had failed) just some time ago. So I downloaded the Orion server to see if it behaved likewise, as this problem nearly drove me mad. Then, in the Orion docs, right from the beginning they almost insisted on copying tools.jar from the JDK to its proper place (/lib or something). And: alas, it worked perfectly. Finally, the same recipe was applied to iAS and showed equal results. And: when it comes to Oracle, consulting their OTN site is no really good idea if searching for something, not even to speak of a solution. Well, Ifinally did so anyway, but my expectations were not disappointed, again. Just to show the level of despair I had finally reached. cheers Stefan Cheers, and HTH, -- Chris (SCPJ2) developing his private things for Struts 1.1 with JDeveloper 10g now.; under SuSE Linux 8.2 and JDK 1.4.2, which is against all official rules (the single supported OS is Windows 2000 | XP and JDK 1.4.1), but up to now, it works just fine anyway ;-) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: java.lang.ArrayIndexOutOfBoundsException
Well, the problem seems to be that I initialized the array too much... Thx... BTJ On Mon, 2003-09-15 at 19:30, Adam Hardy wrote: The exception is occurring when the struts preprocessor tries to populate your form bean with request parameters. I expect you have indexed properties and you have not initialized your form bean with an array to accept them. Adam On 09/15/2003 02:04 PM Bj?rn T Johansen wrote: I have a jsp page that is using nested:iterate to show a list of records, based on some input on the same page. The first time I press the submit button to get the records, everything works like it should. But if I try to get the records one more time, I get this exception: javax.servlet.ServletException: BeanUtils.populate at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1254)
RE: Tiles and Struts.
One way is to make the title a separate tile attribute instead of setting it inside a tile like you are doing. Have a single head section in your layout tile (layout.jsp) and parametrize it as a tile attribute, something like: layout.jsp: --- tiles:useAttribute id=titleKey name=titleKey classname=java.lang.String / html:html head titlebean:message key=%= titleKey % //title !-- other header stuff -- /head ... Now in your actual JSP (whichever one contains your code snipper below): %@ taglib uri=/tags/struts-tiles prefix=tiles % tiles:insert page=../common/layout.jsp flush=true tiles:put name=header value=../common/header.jsp / tiles:put name=leftmenu value=../common/globalleftmenu.jsp / tiles:put name=body-content value=../globaladmin/gblTechnologyBody.jsp / !-- PROVIDE A KEY FOR THE TITLE HERE -- tiles:put name=titleKey value=resource-bundle-key-for-title / tiles:put name=footer value=../common/footer.jsp / /tiles:insert Hope this helps. ..Hrishi -Original Message- From: deepaksawdekar [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 8:45 AM To: Struts Users Mailing List Subject: Tiles and Struts. Hello, We are using struts and tiles for view component of our application. We are facing the problem of setting the title for the jsp. The title has to be taken from the properties file and it depends upon the body of the tiles. Any pointer how to do this. my jsp file is as follows. %@ taglib uri=/tags/struts-tiles prefix=tiles % tiles:insert page=../common/layout.jsp flush=true tiles:put name=header value=../common/header.jsp / tiles:put name=leftmenu value=../common/globalleftmenu.jsp / tiles:put name=body-content value=../globaladmin/gblTechnologyBody.jsp / tiles:put name=footer value=../common/footer.jsp / /tiles:insert I am setting the tile in gblTechnologyBody.jsp file. It works fine when i have html head in all the jsp above. But if i remove html head tag from the jsp it does not work. I am removing the HTML head tag since when i do view source from the it i get 5 different html head and body tags. 4 for the jsp above and one for the layout.jsp. Pl. advice Thanks and Regards Deepak. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Special view information - ActionForm or request?
Sometimes views need special information to display correctly, like a bean with the values needed to render a dropdown list. Is it considered a Struts best-practice to include this information in the ActionForm or should the Action which prepares this information store the information in the request instead? Thanks, Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: One form, multiple JSPs, multiple validations
Check out http://jakarta.apache.org/struts/userGuide/dev_validator.html Under Pluggable Validators there is a section called Multi Page Forms. I've not done this before, but I think this wizard-like functionality you are trying to build is built directly into Struts and the Validator. Matt - Original Message - From: Ruben Carvalho [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, September 15, 2003 12:19 PM Subject: One form, multiple JSPs, multiple validations Good afternoon helpers, I've started a new application using struts 1.1 and I'm having some problems with some new concepts. I want to use XML form validation (DynaValidatorForm) using validator-rules.xml and my validaton.xml. Right now my application is working fine. Now I want to use different validation rules for the same form, accross multiple JSPs. For example: - TestForm is a DynaValidatorForm String name String address - test1.jsp I want to show one text box to fill the name property: (...) html:text property=name / (...) - test2.jsp I want to show one text box to fill the address property: (...) html:text property=address / (...) - struts-config.xml (...) form-beans form-bean name=testForm type=org.apache.struts.validator.DynaValidatorForm form-property name=name type=java.lang.String/ form-property name=address type=java.lang.String/ /form-bean /form-beans (...) - validaton.xml (...) formset form name=logonForm field property=username depends=required arg0 key=prompt.username/ /field field property=address depends=required arg0 key=prompt.address/ /field /form /formset (...) Now, I run http://localhost/app/test1.jsp and I fill in my name property. Then I want my app to validate only the name property. Then I forward to test2.jsp, fill the address property and now I want to validate only the address property. How can I do this? The problem is, what identifies a rule in validation.xml is the form name. I could define different names for my form in the struts-config.xml but imagine if I had 10 JSPs for each form. Thanks in advance Rben Carvalho - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: One form, multiple JSPs, multiple validations
What you're looking for is a way to validate a form with multiple pages. Read this, paying special attention to Multi Page Forms http://jakarta.apache.org/struts/userGuide/dev_validator.html K.C. Ruben Carvalho wrote: Good afternoon helpers, I've started a new application using struts 1.1 and I'm having some problems with some new concepts. I want to use XML form validation (DynaValidatorForm) using validator-rules.xml and my validaton.xml. Right now my application is working fine. Now I want to use different validation rules for the same form, accross multiple JSPs. For example: - TestForm is a DynaValidatorForm String name String address - test1.jsp I want to show one text box to fill the name property: (...) html:text property=name / (...) - test2.jsp I want to show one text box to fill the address property: (...) html:text property=address / (...) - struts-config.xml (...) form-beans form-bean name=testForm type=org.apache.struts.validator.DynaValidatorForm form-property name=name type=java.lang.String/ form-property name=address type=java.lang.String/ /form-bean /form-beans (...) - validaton.xml (...) formset form name=logonForm field property=username depends=required arg0 key=prompt.username/ /field field property=address depends=required arg0 key=prompt.address/ /field /form /formset (...) Now, I run http://localhost/app/test1.jsp and I fill in my name property. Then I want my app to validate only the name property. Then I forward to test2.jsp, fill the address property and now I want to validate only the address property. How can I do this? The problem is, what identifies a rule in validation.xml is the form name. I could define different names for my form in the struts-config.xml but imagine if I had 10 JSPs for each form. Thanks in advance Rben Carvalho - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Google and Struts
Hi, just a simple Question: 1.) does Google follow links to Struts actions (ending with .do)? 2.) if so, does it make a difference if the ;jsessionid thing is appended to the URL? Background is that I'm working on a larger site that uses Struts for request processing and content delivery, with most Actions being mere forwards to static HTML and JSP pages. Now, from the logs I can tell the GoogleBot is analyzing the top page / (which contains an abundance of additional .do links), but then just goes away. Well, that should not be so. Though we've already searched all other resources available on the web, none of them seems to deal with Struts in particular. So finally, I'm asking that question here. In the meantime, we've already tried suppressing all session information (calling the 'default' Forward action will always open up a session and append the 'jsessionid' to all page links if Cookies are disabled - which is the case with Search Robots - regardless if the JSPs don't require a session, and even though this is explicitly switched off via a [EMAIL PROTECTED] % directive stating session=false; quick solution: write a custom PageAction that just does the same). If anybody here has any experience with this Google problem, I'd really be glad to learn from your knowledge. Or does Google generally follow .do links as well, and something else in the site may probably be wrong? To share some of my thoughts, a countermeasure might be to have Struts also handle requests with a .htm (three letters) ending, thus tricking Google into believing to analyze a static file, though in effect, a Struts Action is invoked. It won't be able to tell, not even when forwarding etc. Static HTML files could retain a .html (4 letters) ending and be delivered and indexed as-is. Or the other way round. I'm not sure if I really like this approach, but still. Suppressing the 'jsessionid' thing on the top page didn't make any difference yet. What are your experiences? -- Chris (SCPJ2) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: One form, multiple JSPs, multiple validations
Thank you Matt and K.C. for being so helpful. Sorry everybody for posting such a basic question. I'll try to open my eyes next time (and the userguide). Ruben Carvalho Come on now sugar / Bring it on bring it on yeah / Just remember me when / You're good to go / Come on now honey / Bring it on bring it on yeah / Just remember me when We used to be friends / A long time ago / We used to be friends / A long time ago / We used to be friends / A long time ago / We used to be friends Yeahh The Dandy Warhols -Mensagem original- De: Sgarlata Matt [mailto:[EMAIL PROTECTED] Enviada: seg 15-09-2003 20:43 Para: Struts Users Mailing List Cc: Assunto: Re: One form, multiple JSPs, multiple validations Check out http://jakarta.apache.org/struts/userGuide/dev_validator.html Under Pluggable Validators there is a section called Multi Page Forms. I've not done this before, but I think this wizard-like functionality you are trying to build is built directly into Struts and the Validator. Matt - Original Message - From: Ruben Carvalho [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, September 15, 2003 12:19 PM Subject: One form, multiple JSPs, multiple validations Good afternoon helpers, I've started a new application using struts 1.1 and I'm having some problems with some new concepts. I want to use XML form validation (DynaValidatorForm) using validator-rules.xml and my validaton.xml. Right now my application is working fine. Now I want to use different validation rules for the same form, accross multiple JSPs. For example: - TestForm is a DynaValidatorForm String name String address - test1.jsp I want to show one text box to fill the name property: (...) html:text property=name / (...) - test2.jsp I want to show one text box to fill the address property: (...) html:text property=address / (...) - struts-config.xml (...) form-beans form-bean name=testForm type=org.apache.struts.validator.DynaValidatorForm form-property name=name type=java.lang.String/ form-property name=address type=java.lang.String/ /form-bean /form-beans (...) - validaton.xml (...) formset form name=logonForm field property=username depends=required arg0 key=prompt.username/ /field field property=address depends=required arg0 key=prompt.address/ /field /form /formset (...) Now, I run http://localhost/app/test1.jsp and I fill in my name property. Then I want my app to validate only the name property. Then I forward to test2.jsp, fill the address property and now I want to validate only the address property. How can I do this? The problem is, what identifies a rule in validation.xml is the form name. I could define different names for my form in the struts-config.xml but imagine if I had 10 JSPs for each form. Thanks in advance Rben Carvalho - 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: Passing variables for logic:iterate
On 09/15/2003 01:36:51 PM Gregory F. March wrote: On Sep 15, 2003, Mainguy, Mike [EMAIL PROTECTED] wrote: |1st, Thank you, I didn't realize the logic:Iterate tag had those two |properties, so you've indirectly saved me some effort. : Thanks for the answers... As a first go-round, I'm trying the bean:define suggestion from Robert. On (I believe) the logic:iterate tag, I am getting: [Exception in:/bf/search/results.jsp] java.lang.String and I can't figure out why. How does one go about debugging this kind of thing? I think this might be one of those cases where you go through comment out parts of your JSP code and try again iterations to find what is causing the error. Not very elegant, but it has worked for me. Susan Bradeen Thanks! /greg -- Gregory F. March-=-http://www.gfm.net:81/~march-=- AIM:GfmNet - 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]
TreeMap vs html:optionsCollection
Dear Struts users, I am trying to get my html:optionsCollection to work with a TreeMap. I don't know if this is possible but on the Struts API page for the class OptionsCollectionTag I read the following: The collection may be an array of objects, a Collection, an Enumeration, an Iterator, or a Map. ( http://jakarta.apache.org/struts/api/org/apache/struts/taglib/html/Opti onsCollectionTag.html) Since TreeMap implements SortedMap which is a subinterface of Map, TreeMap should work fine, right? However, when the page is loaded I get the folloing error text: HTTP ERROR: 500 No getter method available for property label for bean under name 1=LabelValueBean[Label 1, Value 1] Can anyone explain this error message? This seems strange to me. The returntype in my ActionFormBean is TreeMap and the code snippet where I build up the TreeMap is like this: eventGroups = new TreeMap(); eventGroups.put( new String( 1 ), new LabelValueBean( Label 1, Value 1 ) ); eventGroups.put( new String( 2 ), new LabelValueBean( Label 2, Value 2 ) ); eventGroups.put( new String( 3 ), new LabelValueBean( Label 3, Value 3 ) ); ((EventGroupBean)form).setEventGroups( eventGroups ); ( Best regards Lasse - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Google and Struts
Google certainly crawls my site, which uses .do actions, and does a pretty good job; I get a number of visitors referred straight into the .do pages (which are all eg showTopic.do?topic=nn) from Google searches. On the other hand, I don't do URL rewriting, so don't have the jsessionid thingies. I took the decision not to do URL rewriting because - I don't need to track sessions - the jsessionid thingies screwed up the crawler from Atomz, which I use to provide site searching. HTH. Louise On Monday, September 15, 2003 at 8:57:56 PM, Christian Bollmeyer wrote: CB Hi, CB just a simple Question: CB 1.) does Google follow links to Struts actions (ending with .do)? CB 2.) if so, does it make a difference if the ;jsessionid thing is CB appended to the URL? CB Background is that I'm working on a larger site that uses CB Struts for request processing and content delivery, with CB most Actions being mere forwards to static HTML and CB JSP pages. Now, from the logs I can tell the GoogleBot CB is analyzing the top page / (which contains an abundance CB of additional .do links), but then just goes away. Well, CB that should not be so. Though we've already searched all CB other resources available on the web, none of them CB seems to deal with Struts in particular. So finally, I'm CB asking that question here. In the meantime, we've CB already tried suppressing all session information CB (calling the 'default' Forward action will always open CB up a session and append the 'jsessionid' to all CB page links if Cookies are disabled - which is the CB case with Search Robots - regardless if the JSPs CB don't require a session, and even though this is CB explicitly switched off via a [EMAIL PROTECTED] % directive CB stating session=false; quick solution: write a custom CB PageAction that just does the same). If anybody CB here has any experience with this Google problem, CB I'd really be glad to learn from your knowledge. CB Or does Google generally follow .do links as well, CB and something else in the site may probably be CB wrong? CB To share some of my thoughts, a countermeasure CB might be to have Struts also handle requests with CB a .htm (three letters) ending, thus tricking Google CB into believing to analyze a static file, though in effect, CB a Struts Action is invoked. It won't be able to tell, CB not even when forwarding etc. Static HTML files could CB retain a .html (4 letters) ending and be delivered and CB indexed as-is. Or the other way round. I'm not sure if CB I really like this approach, but still. Suppressing the CB 'jsessionid' thing on the top page didn't make any CB difference yet. CB What are your experiences? CB -- Chris (SCPJ2) CB - CB To unsubscribe, e-mail: [EMAIL PROTECTED] CB For additional commands, e-mail: [EMAIL PROTECTED] -- Louise Pryor http://www.louisepryor.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: sslext can only get it to post
Yes, Tomcat's handling of the security-constraint is very complementary to the use of sslext. Unfortunately, unless this has changed recently, not all containers behave in this way. Weblogic, for instance, just creates a response that outputs a message to the browser stating that a particular URL is available only by HTTPS. (Maybe this has changed in 8.1, I'll check it out.) Tomcat definitely has the superior implementation on this issue. Steve - Original Message - From: Craig R. McClanahan [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Cc: Stephane Grenier [EMAIL PROTECTED] Sent: Monday, September 15, 2003 10:37 AM Subject: Re: sslext can only get it to post On Sun, 14 Sep 2003, Max Cooper wrote: Some design changes are needed to make the switch to the https port in what I consider to be an acceptable manner. One avenue to explore is using one particular capability of container managed security, and declare a security constraint requiring SSL on a particular request. Something like this: security-constraint web-resource-collection web-resource-nameCheckout Section/web-resource-name description The set of URL patterns for requests that must be submitted via SSL. In order to avoid sending confidential data unencrypted, these patterns MUST include the page that renders the form to be submitted that contains that confidential data. /description !-- URL pattern for the form containing the credit card number -- url-pattern/checkout_form.jsp/url-pattern !-- URL pattern for the buy it submit button -- url-pattern/buy.do/url-pattern /web-resource-collection user-data-constraint transport-guaranteeCONFIDENTIAL/transport-guarantee /user-data-constraint /security-constraint If you do this, the container will switch to HTTPS for you before the checkout form is rendered. Hence, the ultimate submit of that form will be done over SSL. It's up to the container to figure out what the correct SSL port number is (in Tomcat, you configure this with the redirectPort attribute on a Connector element; the default configuration for non-SSL on port 8080 redirects to SSL on port 8443). Note that, because there is no auth-constraint here, this particular security constraint does not require you to use container managed security for authentication -- it's only being used to do the redirect to SSL trick for you. Craig - 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: Passing variables for logic:iterate
On Sep 15, 2003, Susan Bradeen [EMAIL PROTECTED] wrote: |I think this might be one of those cases where you go through comment out |parts of your JSP code and try again iterations to find what is causing |the error. Not very elegant, but it has worked for me. Thanks Susan, that's what I wound up doing. Still not sure what it was (maybe an empty string for one of my iterate properties?). Too bad it doesn't give some form of a stack trace... /greg -- Gregory F. March-=-http://www.gfm.net:81/~march-=-AIM:GfmNet - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: TreeMap vs html:optionsCollection
I haven't used maps with html:optionsCollection so I don't know if I can give you a definite answer on this. The optionsCollection tag is expecting a collection of objects that it can call .getLabel() and .getValue() on (by default but it can be changed with parameters). To get a list of objects from a map you normally call object.entrySet which you can then iterate over. The entry set is a set of Map.Entry objects (they have getKey and getValue methods). So it looks like the tag is trying to do a .getLabel() on the Map.Entry object. If the tag does accept maps I would have expected that it knows about Map.Entry objects. I normally use List objects with pull-downs instead, like this: List eventGroups = new ArrayList(); eventGroups.add(new LabelValueBean(Label 1,Value 1)); eventGroups.add(new LabelValueBean(Label 2,Value 2)); eventGroups.add(new LabelValueBean(Label 3,Value 3)); ((EventGroupBean)form).setEventGroups( eventGroups ); Lars Bergstrm wrote: Dear Struts users, I am trying to get my html:optionsCollection to work with a TreeMap. I don't know if this is possible but on the Struts API page for the class OptionsCollectionTag I read the following: The collection may be an array of objects, a Collection, an Enumeration, an Iterator, or a Map. ( http://jakarta.apache.org/struts/api/org/apache/struts/taglib/html/Opti onsCollectionTag.html) Since TreeMap implements SortedMap which is a subinterface of Map, TreeMap should work fine, right? However, when the page is loaded I get the folloing error text: HTTP ERROR: 500 No getter method available for property label for bean under name 1=LabelValueBean[Label 1, Value 1] Can anyone explain this error message? This seems strange to me. The returntype in my ActionFormBean is TreeMap and the code snippet where I build up the TreeMap is like this: eventGroups = new TreeMap(); eventGroups.put( new String( 1 ), new LabelValueBean( Label 1, Value 1 ) ); eventGroups.put( new String( 2 ), new LabelValueBean( Label 2, Value 2 ) ); eventGroups.put( new String( 3 ), new LabelValueBean( Label 3, Value 3 ) ); ((EventGroupBean)form).setEventGroups( eventGroups ); ( Best regards Lasse -- Jason Lea - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Slow file upload?
I am testing file upload using Struts and FormFile but the upload seems really slow. Uploading a 1,5MB file takes about 15-20 sec. and I am running both the server and the browser on the same PC. Is this normal or should the upload be faster? BTJ
[OT] Java Class to match US state abbreviations with their full name?
Just wondering if anyone offhand knew of a open source java class for matching state abbreviations with their full name.. I could write something to do it myself easily enough but I'm not encredibly interested in doing it =) Thanks David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
validation question
Hello all. Is there any way to decide if I want to validate the jsp within the action rather than in struts-config ? Thank you, Stephane
Re: Passing variables for logic:iterate
Gregory F. March wrote: On Sep 15, 2003, Susan Bradeen [EMAIL PROTECTED] wrote: |I think this might be one of those cases where you go through comment out |parts of your JSP code and try again iterations to find what is causing |the error. Not very elegant, but it has worked for me. Thanks Susan, that's what I wound up doing. Still not sure what it was (maybe an empty string for one of my iterate properties?). Too bad it doesn't give some form of a stack trace... /greg -- Gregory F. March-=-http://www.gfm.net:81/~march-=-AIM:GfmNet - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] You said you have these entries in your form: form-property name=pageOffset type=java.lang.String/ form-property name=pageLength type=java.lang.String/ But the logic:iterate tag offset and length attributes need the following: This can be either an integer that directly expresses the desired value, or the name of a JSP bean (in any scope) of type java.lang.Integer that defines the desired value. You need to pass it Integer objects or put the actual values into the tag. JSTL might be a better way with the c:forEach tag. -- Jason Lea - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DynaValidatorForm and Multi-page validation
Hi, I was also having the same problem, and I dropped validation frame work for multi page validation and using for regular validation. If you get answer, please let me know at [EMAIL PROTECTED] Thanks, Anand From: Natalie D Rassmann [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: DynaValidatorForm and Multi-page validation Date: Mon, 15 Sep 2003 09:10:54 -0400 Hi - I am having trouble with my DynaValidatorForm and Multi-page validation. It does not seem to utilize the page property. I tried putting in a page property but I get Struts errors. When I add the page property to the struts-config file for that form, and I add the page property as an integer, I get a Null pointer exception. When I put the page property as a string, I get a ClassCastException. No matter what I do, I can't get the page validation to work. Does anyone have a clue? Can anyone help me?? Thanks in advance, Natalie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: DynaValidatorForm and Multi-page validation
Anand, The DynaValidatorForm already has a getPage()/setPage() set of functions. Just use those. My common two problems were a little different: a) forgetting to use the 'page=X' in my html:javascript tag b) forgetting to use the formName=someFunctionName in the html:javascript tag when I was using ValidatorActionForms or DynaValidatorActionForms I hope this helps, David -Original Message- From: Anand M S [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 5:16 PM To: [EMAIL PROTECTED] Subject: Re: DynaValidatorForm and Multi-page validation Hi, I was also having the same problem, and I dropped validation frame work for multi page validation and using for regular validation. If you get answer, please let me know at [EMAIL PROTECTED] Thanks, Anand From: Natalie D Rassmann [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: DynaValidatorForm and Multi-page validation Date: Mon, 15 Sep 2003 09:10:54 -0400 Hi - I am having trouble with my DynaValidatorForm and Multi-page validation. It does not seem to utilize the page property. I tried putting in a page property but I get Struts errors. When I add the page property to the struts-config file for that form, and I add the page property as an integer, I get a Null pointer exception. When I put the page property as a string, I get a ClassCastException. No matter what I do, I can't get the page validation to work. Does anyone have a clue? Can anyone help me?? Thanks in advance, Natalie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus - 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: [OT] Java Class to match US state abbreviations with their fu ll name?
http://tinyurl.com/ngnc HTH, Matt -Original Message- From: David Erickson [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 3:07 PM To: Struts Mailing List Subject: [OT] Java Class to match US state abbreviations with their full name? Just wondering if anyone offhand knew of a open source java class for matching state abbreviations with their full name.. I could write something to do it myself easily enough but I'm not encredibly interested in doing it =) Thanks David - 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: DynaValidatorForm and Multi-page validation
There are APIs which handle wizard-based forms in Struts, such as Struts Wizard (http://sourceforge.net/projects/strutswizard/) or Struts WorkFlow (http://www.livinglogic.de/Struts/introduction.html)... HTH, Thomas At 23:15 15/09/2003, you wrote: Hi, I was also having the same problem, and I dropped validation frame work for multi page validation and using for regular validation. If you get answer, please let me know at [EMAIL PROTECTED] Thanks, Anand From: Natalie D Rassmann [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: DynaValidatorForm and Multi-page validation Date: Mon, 15 Sep 2003 09:10:54 -0400 Hi - I am having trouble with my DynaValidatorForm and Multi-page validation. It does not seem to utilize the page property. I tried putting in a page property but I get Struts errors. When I add the page property to the struts-config file for that form, and I add the page property as an integer, I get a Null pointer exception. When I put the page property as a string, I get a ClassCastException. No matter what I do, I can't get the page validation to work. Does anyone have a clue? Can anyone help me?? Thanks in advance, Natalie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus - 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: where I put my property files?
You have to put it/them under WEB-INF/classes Regards, Marco !-- ORIGINAL MESSAGE -- From: =?iso-8859-1?Q?Mariano_Garc=EDa?= [EMAIL PROTECTED] Hi all, Where I have to put property files? I am using Tomcat and Struts. I = suppose I have to put them in WEB-INF directory, but my application cannot find them. Maybe I have to add something in struts-config.xml Could you help me, please? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validating indexed Select Values Fails
I have a form with multiple selects all with the same name and indexed values (i.e myValue[0]. myValue[1]...). When I sumbit my form to validate, validation quits when first select validation fails. Has anyone had this problem? And how did you solve it? Thanks George - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: validation question
In your action mappings in struts-config, you can set validate=false, and do your validation in the action class. Not sure if this is what you want. Saul -Original Message- From: Stephane Grenier [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 5:12 PM To: Struts Users Mailing List Subject: validation question Hello all. Is there any way to decide if I want to validate the jsp within the action rather than in struts-config ? Thank you, Stephane - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: where I put my property files?
WEB-INF/classes ... WEB-INF/classes/resources say you have application.properties, configuration.properites in your web.xml servlet servlet-classorg.apache.struts.action.ActionServlet/servlet-class init-param param-nameapplication/param-name param-valueresources.application/param-value /init-param init-param param-nameconfiguration/param-name param-valueresources.configuration/param-value /init-param . /servlet it knows to look in WEB-INF/classes/resources/application.properties WEB-INF/classes/resources/configuration.properties - Original Message - From: Marco Tedone [EMAIL PROTECTED] To: Struts-user-list [EMAIL PROTECTED] Sent: Monday, September 15, 2003 2:29 PM Subject: Re: where I put my property files? You have to put it/them under WEB-INF/classes Regards, Marco !-- ORIGINAL MESSAGE -- From: =?iso-8859-1?Q?Mariano_Garc=EDa?= [EMAIL PROTECTED] Hi all, Where I have to put property files? I am using Tomcat and Struts. I = suppose I have to put them in WEB-INF directory, but my application cannot find them. Maybe I have to add something in struts-config.xml Could you help me, please? - 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]