Re: AW: How to submit form in pop-up window and forward parent results page? [OT]
Your "editItem" action, when the update is finished, forwards to "autoCloseAndReloadOpener.jsp" autoCloseAndReloadOpener.jsp does steps (5) and (6):
ASP.NET and Struts: Web Application Architectures
Interesting reading... http://msdn.microsoft.com/asp.net/using/migrating/default.aspx?pull=/library/en-us/dnaspp/html/aspnet-aspnet-j2ee-struts.asp#aspnet-aspnet-j2ee-struts_topic4 Regards. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Action form
I think you are searching for DynaActionForm. Take a look at http://www.reumann.net/do/struts/lesson3/step4 I personally don't like them because of debug difficulties. Regards, Guido. Pradeep, PK wrote: Is it mandatory to create ActionForm class for each JSP if we want to send the form data to action class? Does it not make the ActionForm class dependent on the UI and liable to change as an when modifications is done in JSP page? Is there a way of dynamically creating the ActionForm class instance relevant to JSP page which can be used by Action Class? I am new to struts and pardon me if this question is out of my ignorance of understanding of struts.. Warm Regards, Pradeep - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Guido García Bernardo - [EMAIL PROTECTED] Tfn. +34 983 54 89 08 ITDEUSTO - Valladolid -BEGIN PGP PUBLIC KEY BLOCK- Version: GnuPG v1.2.4 (MingW32) mQGiBEA08WoRBACha4gpug/FDUiKsAyvAOxuHc0IijZf4rBHuGoq/T89cyR5JJrD X6gsLvvg5q460eU3iMpAnFCNLjOKKpj2kqjfWmtTi551q6dZ3akTzFrohCNnOyXF 4LycMowqnFIrhp1EOi9PPvhlGXwi/C81/yH3RSIubB1R3zCcJSJuccd4XwCgniZk sfw81etG7nfER7uiTAplDQcD/3pHgANqKc/xY8w/yMfBU7PnPfmsa1nqhpnkiw5X F9DwU3t8pcswifnTRRgfDX0uxZER/9j4z9nBoTgl/nJaXa2rO3qWpiHaSCIOi51Y LYhkJkb6zZshDuTereunIf/BKV1qhpUKRCKCu+pDojYic+15ZlVAADRN/hUGSPEL ec3pA/0fYj2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YuABpohJBBgRAgAJBQJANPGK AhsMAAoJEBBTGX2qD3YkfQsAni/ESTfETyZv7g9KQDJ8LSH0ajwjAKCaqrnyNBWi 0/52HHRsobw69NSdyA== =l6cK -END PGP PUBLIC KEY BLOCK- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Re: IBatis???
www.ibatis.com iBATIS SQL Maps provides a very simple and flexible means of moving data between your Java objects and a relational database. Use the full power of real SQL without a single line of JDBC code! http://www.ibatis.com/common/sqlmaps.html iBATIS DAO is an abstraction layer that hides the details of your persistence solution and provides a common API to the rest of your application. http://www.ibatis.com/common/dao.html Regards [EMAIL PROTECTED] wrote: Hi, can any one tell me what is IBatis? where can i get reference doc/tutorial for the same Thanks and Regards O. Subramaniam. Tata Consultancy Services. Chennai. Mailto: [EMAIL PROTECTED] Website: http://www.tcs.com DISCLAIMER: The information contained in this message is intended only and solely for the addressed individual or entity indicated in this message and for the exclusive use of the said addressed individual or entity indicated in this message (or responsible for delivery of the message to such person) and may contain legally privileged and confidential information belonging to Tata Consultancy Services. It must not be printed, read, copied, disclosed, forwarded, distributed or used (in whatsoever manner) by any person other than the addressee. Unauthorized use, disclosure or copying is strictly prohibited and may constitute unlawful act and can possibly attract legal action, civil and/or criminal. The contents of this message need not necessarily reflect or endorse the views of Tata Consultancy Services on any subject matter. Any action taken or omitted to be taken based on this message is entirely at your risk and neither the originator of this message nor Tata Consultancy Services takes any responsibility or liability towards the same. Opinions, conclusions and any other information contained in this message that do not relate to the official business of Tata Consultancy Services shall be understood as neither given nor endorsed by Tata Consultancy Services or any affiliate of Tata Consultancy Services. If you have received this message in error, you should destroy this message and may please notify the sender by e-mail. Thank you. - 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]
[OT] Re: populating session object
Maybe you can use the application scope: foo.Employees employees = (foo.Counter)getServletContext().getAttribute("employees"); if (employees == null) { employees = new foo.Employees(); getServletContext().setAttribute("employees", employees); } and then Be careful, because I am almost sure that objects placed in application scope will be used by more than one thread so you must design them accordingly. Regards! Guido García PD. BTW, is there any _free_ memory profiler or something similar to JProbe or OptimizeIt? shankarr wrote: Hello! Currently, in my design, I am using a DO class and a DOService class for my business logic. In my case, I make a db query to get a list of all employees. But, at the end, the result has to be set in a session or in a request object. Given a case where we have lots of users making a get, I believe the memory requirement will go up and will need a very high RAM. Is there any other way of handling this or I am missing something? Richie "To achieve all that is possible, one must attempt the impossible" - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Re: log4j integration
This is OT. The word "struts" in a message is not the only thing it needs to be struts related... Try PropertyConfigurator.configureAndWatch, I think that is what you are searching for... You cand find a simple example at http://www.jguru.com/forums/view.jsp?EID=1130416 Un saludo, chicos. Guido. shankarr wrote: Hi! I have integrated log4j with struts. I need to know how to ensure that the changes done to log4j.properties file is taken into account at run time. TIA, Richie "To achieve all that is possible, one must attempt the impossible" - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Re: beans
This is a very good "how not to ask a question" example... (spam included!!) The only thing he has forgot is the "THIS IS VERY IMPORTANT, PLEASE HELP" in the subject... Anyway http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=utf-8&q=run+a+jsp+and+a+bean Regards xavier manohar wrote: hi can anyone help me to run a jsp and a bean. regards mano Yahoo! India Mobile: Ringtones, Wallpapers, Picture Messages and more.Download now. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Re: Tool for jsp debug
This is very OT. http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=utf-8&q=tool+for+jsp+debug Florin Pop wrote: Hi, does anyone know a tool for debugging jsp files? So that you are able to trace the code in the jsp source not in the generated servlets. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Prevent direct access to jsp pages
http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=utf-8&q=prevent+direct+access+to+jsp+pages Florin Pop wrote: Hi, I have a jsp page which contains some comboboxes. I set the data in the comboboxes in an Action before forwarding to the jsp. How can I prevent direct access to the jsp page? So everytime a user wants to access the jsp he/she should execute first the Action, in order to fill the data in the combos. Thanks, Florin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] JSP editor - plugin for eclipse ?
You asked the right mailing list. Divya B Sridhar wrote: Hi All, Do we have a plugin for eclipse which would check JSP syntax at save time/compilation time or so? Since Eclipse would recognise Java keywords if JDK is installed; similarly, do we have a plugin for eclipse which enables eclipse to recognise JSP tags? Thanks for any inputs, Regards, Divya. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts and webservices
Hello Our project is not Struts based. We must expose operations as xml services (not standard web services) with a structure like the following one: We want to migrate it to Struts, so the first step is to map that XML structure into an ActionForm... I think we must overwrite RequestProcessor doing: public MyRequestProcessor extends RequestProcessor { ActionForm processActionForm( req, res ) { if (client is a xml service) { SAXBuilder builder = new SAXBuilder( req.getInputStream() ); ... // THE MAIN PROBLEM IS HERE !! ActionForm form = new LoginActionForm(); <-- form.setUserName( username ); form.setPassword( pass ); return form; } else { return super.processActionForm( req, res ); } } } My questions are: 1. How can I know the ActionForm class in each case (it is not always a LoginActionForm...)? 2. Is there any advantage/drawback with etending RequestProcessor? (maybe I can't use other RequestProcessors like Tiles or Validator ones) 3. Should we do anything with ActionServlet, extending it instead of RequestProcessor, etc. Any kind of opinion, sugerence or any other consideration are welcome!! Thank you very very much, Guido García Bernardo PD. BTW, is there any practical information or project about integrating Struts and standard webservices (soap...)? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validations - 'format' vs 'business'
I really think that is a good aproach. At least one of the most simple and centralized. BUT ...from a "pure struts" point of view someone can think that your solution is mixing the model with the view. I think ActionForm should remains as part of the view, or just a 'box' between the view and the controller. What do you think? On the other hand, I _must_ expose business logic as a API for other projects. With this fact in mind, business methods should be implemented doing validations again (defensive programming, you need to think about possible errors from your users and don't assume anything...). HOW without duplicated code? Thank you again, Guido García Bernardo Vic Cekvenich wrote: {repost} I just override validate() method on formbean and do all there, including super.validate() that reads validation.xml. In here I call DAO's to do business validation also, ex: what is the available credit for the client to place this order. Then in action I do this: errors = formbean.validate(); hth, .V Guido García Bernardo wrote: Hi, I have a design doubt... I must validate data coming from a form. This consist typically of: - 'format' validations (i.e. a field is not empty or it is numeric) that I do in the validate method of the ActionForm - 'business' validations that usually require a DB access I actually do 2 steps (actions) per operation. One of them prepare the data and the second one does the operation itself. And here comes my first question: ¿¿is there any other better aproach?? Maybe something similar to a Tiles Controller to prepare the data... class PreOperationAction extends Action { public ... execute ( ... ) { // Create JavaBeans to populate html selects and several inputs (requires DB access) and include them in the request // Forward to error/success jsp } } class PostOperationAction extends Action { public ... execute ( ... ) { // Get data from ActionForm // Business validations (the selected values and inputs are valid from the business point of view) // Execute business logic (encapsulated in external business logic classes) // Forward to error/success jsp } } At this point I don't know what is better (from a MVC perspective). 1. Do it as actually, that is, doing business validation before business logic. This way I think I can't expose the business logic as an API or as a web service. 2. Include all the validations (business and format) into the business logic classes. This way I must duplicate format validations 3. Doing a OperationValidations class (? only a vague idea) 4. Is there any pattern or any best practice related? Does Validator Plugin allow complex business validations? Finally, I need your opinion about handling validation errors: 1. Throwing an Exception from the business logic classes and catch it in the Action (or declare the exception in struts-config.xml) 2. Returning null (or -1, or a no-sense value) from the business logic classes 3. Any other way... Thank you very much, Guido García Bernardo. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Validations - 'format' vs 'business'
Hi, I have a design doubt... I must validate data coming from a form. This consist typically of: - 'format' validations (i.e. a field is not empty or it is numeric) that I do in the validate method of the ActionForm - 'business' validations that usually require a DB access I actually do 2 steps (actions) per operation. One of them prepare the data and the second one does the operation itself. And here comes my first question: ¿¿is there any other better aproach?? Maybe something similar to a Tiles Controller to prepare the data... class PreOperationAction extends Action { public ... execute ( ... ) { // Create JavaBeans to populate html selects and several inputs (requires DB access) and include them in the request // Forward to error/success jsp } } class PostOperationAction extends Action { public ... execute ( ... ) { // Get data from ActionForm // Business validations (the selected values and inputs are valid from the business point of view) // Execute business logic (encapsulated in external business logic classes) // Forward to error/success jsp } } At this point I don't know what is better (from a MVC perspective). 1. Do it as actually, that is, doing business validation before business logic. This way I think I can't expose the business logic as an API or as a web service. 2. Include all the validations (business and format) into the business logic classes. This way I must duplicate format validations 3. Doing a OperationValidations class (? only a vague idea) 4. Is there any pattern or any best practice related? Does Validator Plugin allow complex business validations? Finally, I need your opinion about handling validation errors: 1. Throwing an Exception from the business logic classes and catch it in the Action (or declare the exception in struts-config.xml) 2. Returning null (or -1, or a no-sense value) from the business logic classes 3. Any other way... Thank you very much, Guido García Bernardo. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: java.lang.VerifyError
I have seen that exception... when I try to use a 1.4 compiled Java class under a 1.2 jvm. Try googling... Regards, Guido. Vasi wrote: HI All, I am facing a typical issue. I have the following code in my jsp page. When I remove this code and excute, I have no issues, but I run the code with this, i get the below mentioned error. Appreciate your help. [Jsp Code] <% if(current_location!=null){ %> <%=current_location%> Alabama Alaska Arizona Arkansas California Colorado Connecticut Delaware <% }else {%> Please Select One Alabama Alaska Arizona Arkansas California Colorado Connecticut Delaware html:select> <% } %> <% if(preferred_location!=null){ %> <%=preferred_location%> Alabama Alaska Arizona Arkansas California Colorado Connecticut Delaware <% }else {%> Please Select One Alabama Alaska Arizona Arkansas California Colorado Connecticut Delaware <% } %> [/Jsp Code] Root cause: java.lang.VerifyError: (class: _0002feditcandidate_0002ejspeditcandidate_jsp_7, method: _jspService signature: (Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletR espo nse;)V) Illegal target of jump or branch at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:1576) at java.lang.Class.getConstructor0(Class.java:1748) at java.lang.Class.newInstance0(Class.java:266) at java.lang.Class.newInstance(Class.java:249) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.load(JspServlet.j ava: 116) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(J spSe rvlet.java:154) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServle t.ja va:164) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391) RegdsVasi -- Guido García Bernardo - [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> Tfn. +34 983 54 89 08 IT DEUSTO <http://www.itdeusto.com> - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: When HashMap will replace ActionForm ?
or "philosophical purity should always yield to pragmatism" Hookom, Jacob wrote: Anyone who's done major business application development knows that academic arguments on programming 'style' get thrown right out the window in favor of efficient progress ;-) -Original Message- From: Trieu, Danny [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 10:38 AM To: 'Struts Users Mailing List' Subject: RE: When HashMap will replace ActionForm ? I don't want to offense any one, and all though HashMap or DynaWhatever are convenience, but isn't it anti OO? Meaning there are no type checking, and you are just passing a bag of chunk around? Danny Trieu Internet Business Group Downey Savings and Loan Association, F.A. [EMAIL PROTECTED] "The beginning of knowledge is the discovery of something we do not understand." - Frank Herbert (1920-1986) "The essence of knowledge is, having it, to apply it; not having it, to confess your ignorance." - Confucius (551-479 BC) -Original Message- From: Navjot Singh [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 2:43 AM To: Struts Users Mailing List Subject: RE: When HashMap will replace ActionForm ? I can't say there will be any move or not. But MAP backed ActionForms are alreadt there, If you are not interested in using the actionforms and be contended with just hashmaps. Mostly, not always, I treat ActionForm as HashMap but with getter setter already classcasted and defined for properties. not more than that. -Original Message- From: Antony Paul [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 2:40 PM To: struts Subject: When HashMap will replace ActionForm ? Hi, Is there any move to support HashMap in place of ActionForm ?. I dont want to start any argument. I have read a lot on ActionForm in this archive. rgds Antony Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RES: Subclassing ActionServlet
This way you can't extend other 'struts core actions' (Dispatch, Lookup...). I think a better way may be: - Using a filter (servlet 2.3) in order to pre and post process the request - Extending RequestDispatcher Regards, Guido. PD. I am not sure, but i think you can find a discussion about that in Struts in Action. Felipe Nascimento wrote: A simple way that I use do go: Super Action class, like: UserMustBeLoggedAction{ execute(attribs){ verify session stuff if ok -> myExecute(attribs); else return ActionForward; } abstract myExecute(attribs); } NewAction extends UserMustBeLoggedAction{ myExecute(){ .. } } What do experts recommend?? Regards Felipe -Mensagem original- De: Gopal Venkata Achi [mailto:[EMAIL PROTECTED] Enviada em: quinta-feira, 4 de dezembro de 2003 18:55 Para: Struts Users Mailing List Assunto: RE: Subclassing ActionServlet Hi I have come across a plug-in for Struts, that is called as SAIF (Struts Action Invocation Framework), which enables us to write a pre-action and post action methods. You can use PreAction method for doing all the session authentication, etc., I did not really use this, but the features are available at : http://struts.sourceforge.net/saif/ <http://struts.sourceforge.net/saif/> Any thoughts on this. Regards, Gopal -Original Message- From: Fullam, Jonathan [mailto:[EMAIL PROTECTED] Sent: Thu 12/4/2003 1:07 PM To: 'Struts Users Mailing List' Cc: Subject: Subclassing ActionServlet All, I need to check the Session for an authenticated user before most requests. To do this I subclassed ActionServlet and only call super(request, response) upon verification that authenticated user is in the Session. if (request.getRequestURI().endsWith("welcome.do") | request.getRequestURI().endsWith("logon.do") | request.getRequestURI().endsWith("html")) { super.process(request, response); } else if (request.getSession().getAttribute("USER") == null) { //Forward to login page response.sendRedirect("/welcome.do"); } I also know about the ability to subclass the RequestProcessor and providing my own implementation of the processPreprocess method to accomplish the same thing. Does anybody know of any serious disadvantages or side effects of subclassing the ActionServlet class rather than the RequestProcessor class. --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.547 / Virus Database: 340 - Release Date: 2/12/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.547 / Virus Database: 340 - Release Date: 2/12/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Guido García Bernardo - [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> Tfn. +34 983 54 89 08 IT DEUSTO <http://www.itdeusto.com> - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Displaying a dialogue box with Struts... [OT]
This is not really Struts related... You can do it with JavaScript (IE only) var result = showModalDialog( 'dialog.jsp','','dialogHeight:10;status:no;'); And in the 'dialog.jsp' use the returnValue: I think there is not other way with javascript (all the things I tried were easily bypassed by the usr)... May be a 'server' based solution with Java, to be sure that the user has choosed an option? Regards. Zakaria khabot wrote: Hi!! How to display a dialog box using struts. The dialog box will contain two button (Ok and Cancel). Thanks... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]