RE: Robustly handle double-submit?
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg37248.html -Original Message- From: Thomas Eichberger [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 09, 2002 3:10 PM To: Struts Users Mailing List Subject: RE: Robustly handle double-submit? Could you PLEASE post it again. I got a list of quite strange pages when I was searching for your posting... Thomas At 15:05 09.10.2002 -0500, you wrote: I think I posted a client side, JavaScript solution here - just don't let the user hit submit more than once. Let me know if you don't find it. -Original Message- From: Jerome Jacobsen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 09, 2002 2:54 PM To: Struts User Subject: Robustly handle double-submit? Hi, I've seen the Struts 1.1b2 example's use of the Token for transaction control technique. This is in EditRegistrationAction and SaveRegistrationAction. However, I'd like to know if there is a more robost solution to this problem. I'd like the ability to ignore the second posting and still return the results from the first. That is, act as if the second posting never occurred. Is there a way to do this? Can you give me an example? The problem with the Struts example's approach is that the user doesn't really know what to do next after the error is displayed. They don't get their display results from the first posting. Jerome -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Robustly handle double-submit?
I think I posted a client side, JavaScript solution here - just don't let the user hit submit more than once. Let me know if you don't find it. -Original Message- From: Jerome Jacobsen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 09, 2002 2:54 PM To: Struts User Subject: Robustly handle double-submit? Hi, I've seen the Struts 1.1b2 example's use of the Token for transaction control technique. This is in EditRegistrationAction and SaveRegistrationAction. However, I'd like to know if there is a more robost solution to this problem. I'd like the ability to ignore the second posting and still return the results from the first. That is, act as if the second posting never occurred. Is there a way to do this? Can you give me an example? The problem with the Struts example's approach is that the user doesn't really know what to do next after the error is displayed. They don't get their display results from the first posting. Jerome -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: [OT][FRIDAY] brain types
They ripped off Kiersey Bates and don't even seem to give them credit! See http://www.amazon.com/exec/obidos/tg/detail/-/0960695400/qid=1033749305/sr=8 -2/ref=sr_8_2/002-7896442-4256040?v=glancen=507846 However, this is a great assesment. I've used it with a number of groups over the years. Most people find that the description of their personality is very accurate. It certainly helped me understand myself a lot better. -Original Message- From: Dan Cancro [mailto:[EMAIL PROTECTED]] Sent: Friday, October 04, 2002 11:27 AM To: '[EMAIL PROTECTED]' Subject: [OT][FRIDAY] brain types What types of brains do Struts users have? http://www.braintypes.com/news_from.htm#letters Mine's an ISTJ type -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: [OT][FRIDAY] brain types
-Original Message- From: Joe Barefoot [mailto:[EMAIL PROTECTED]] Sent: Friday, October 04, 2002 12:52 PM To: Struts Users Mailing List Subject: RE: [OT][FRIDAY] brain types Seriously: This type of categorization serves no purpose whatsoever except to erect divisions amongst humanity. Do On the contrary, the goal is better communication between people with different temperaments. This is not labeling like has been done with kids and things like reading level. There is no good or bad temperament, just differences that affect behavior and communication. not be fooled. Also, if you want to understand yourself better, take a trip to the mountains and contemplate your life with respect to the cosmos--identifying with some group or category tells you ZERO about who you really are as a unique individual. I'd challenge you to read Please Understand Me and see if you might find *some* insight. attachment: winmail.dat -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: report generators that plays well with struts
http://inetsoftware.de -Original Message- From: Vincent Stoessel [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 19, 2002 11:55 AM To: Struts Users Subject: OT: report generators that plays well with struts Hello, I was wondering if there are any EJB components for generating reports out of an jdbc datasource? something that plays well with tomcat/struts? Thanks. -- Vincent Stoessel Linux Systems Developer vincent xaymaca.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: report generators that plays well with struts
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg33929.html Also, inetsoftware is coming out with a designer. -Original Message- From: Vincent Stoessel [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 19, 2002 12:32 PM To: Struts Users Mailing List Subject: Re: report generators that plays well with struts Very nice, even available as an EJB. Dependent on one having access to Crystal Reports though. Any open source alternatives? Crystal Reports seems to be the top choice for reporting so I might just bite the bullet on that one. Brad Rhoads wrote: http://inetsoftware.de -Original Message- From: Vincent Stoessel [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 19, 2002 11:55 AM To: Struts Users Subject: OT: report generators that plays well with struts Hello, I was wondering if there are any EJB components for generating reports out of an jdbc datasource? something that plays well with tomcat/struts? Thanks. -- Vincent Stoessel Linux Systems Developer vincent xaymaca.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Vincent Stoessel Linux Systems Developer vincent xaymaca.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Multiple submits
/SCRIPTSCRIPT language=javascript type=text/javascript !-- //This include file contains some JavaScript functions to prevent users //from submitting a form twice. It sets a flag (FormSubmitted) to false //when the page first loads. Then, when the form is submitted, this flag //is checked. If it is true, it tells the user that they have already //submitted the form and prevents the second submission. If it is false //it toggles the flag true (which prevents the next submission) and //submits the form. The flag can be reset if subsequent submissions are //required. One example would be if the user changes information on the //form and then re-submits. In this case, the ResetFormSubmitted function //should be called in the onChange event of any form item that can be //changed. //Initialize the FormSubmitted variable var FormSubmitted = false; function DoubleSubmitCheck() //Call this function in the form's onSubmit attribute { //Check if the form has previously been submitted if(FormSubmitted) //It was { //Alert the user and cancel the submission alert(You have already submitted this form. Please wait for it to be + processed...\n\nNOTE: If you pressed your browser's 'Stop' button + after submitting this form, you'll have to press the 'Reload' or + 'Refresh' button before you can re-submit.) return false; } else //It was not (this is the first time it was submitted { //Set the FormSubmitted flag to true and return true to process the form FormSubmitted = true; return true; } } function ResetFormSubmitted() { //Call this function if you wish to allow another submit, like if //data is changed FormSubmitted = false; } //-- /SCRIPT form method=POST name=custinfo action=xxx onSubmit=return DoubleSubmitCheck(); -Original Message- From: Rahul Kumar Saxena [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 30, 2002 5:36 AM To: [EMAIL PROTECTED] Subject: Multiple submits Hi All, I am facing a problem related to multiple sumbits. We are developing a wizard kind of application with frames. For this we use business object(BO), which are nothing but a replica of forms, used in JSPs. We store this BO in session and keep on updating it with the values present in various forms. At the end, we pass this BO to EJB layer to process the DB operations after which we display success or failure page depending on the success of DB operation. To do final submit we display OK and Cancel button in all the JSPs along with Next button. After successful DB operation we remove BO from session (to make session light).This is where our problem starts. If user clicks final OK and first thread completes the DB operation; just before the success page loading user clicks Next button. Then second thread tries to look into BO which was stored in session, for some values. Since first thread has already removed the BO from session, second thread throws NullPointerException. Not only this if user clicks OK button, more than once then we land up either with same record entered in DB more than once or again NullPointerException. I went through various threads and almost every where people talk about using Tokens. If I use tokens then what shall I do if token is invalid? I can't show him a page saying that your first request is under process, 'coz at the end I have to forward the request to success page. TIA, * RAHUL K. SAXENA Sr. Systems Engineer, Wipro Technologies, Ground Floor, Tower II, 72, Electronic City, Hosur Main Road, Bangalore-561 229, India. Ph: 91-80-8520408/416(x-2026) * -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Security and Struts
http://jakarta.apache.org/tomcat/tomcat-4.0-doc/realm-howto.html -Original Message- From: Ryan Cuprak [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 30, 2002 1:53 PM To: [EMAIL PROTECTED] Subject: Security and Struts Hello, I was hoping someone would have some advice on securing a website using struts. I am developing a webapp that has to be secure (password protected) and which restricts access to different parts of the site depending on the roles a user possesses. The roles each user has are stored as XML in a database and may be configured by an administrator. Does struts have any built-in security capabilities that I could take advantage of? Any help/pointers would be much appreciated! My first guess would be to put all jsp pages in WEB-INF (use only ForwardAction to get to each page) and subclass ActionServlet with the logic for check authentication etc. However, will this cause any problems when it comes to a user book marking a page? Thanks, -Ryan Cuprak -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
session var missing in .jsp
All but one of my .jsps are views and go though my template. They're all mapped to screenname.screen. I have code (shown below) at the top my template to check a session var to see if the user has logged on. That works fine. But now I have a .jsp that's just for displaying an (crystal clear report viewer) applet. And the .jsp has call back functions used by the applet, so I can't use the template. I put this code at the top of my rptloader.jsp, but I get a NPE in this case. % try { if (session != null){ com.monolith.model.administration.User user = (com.monolith.model.administration.User)session.getAttribute( com.monolith.webapp.Constants.USER_KEY); if (user == null) response.sendRedirect(/WebSynapse/signon.screen?prob=no); } else response.sendRedirect(/WebSynapse/signon.screen?prob=yes); } catch(NullPointerException npe) { response.sendRedirect(/WebSynapse/signon.screen?prob=npe); } % I have a selectreport.screen that ends up at my ReportViewAction where I figure out what kind of report was requested. Then to actually execute the report I do: if (usePDF == true) return (new ActionForward(/report.pdf, false)); else if (useHTM == true) return (new ActionForward(/report.htmr, false)); else //response.sendRedirect(/rptloader.jsp?report=/reports/+reportType.trim()+ .rptdll=pdsora7.dll); return (new ActionForward(/rptloader.jsp?report=/reports/+reportType.trim()+.rptdll= pdsora7.dll, true)); //return (new ActionForward(/rptloader.screen?report=/reports/+reportType.trim()+.rptd ll=pdsora7.dll, false)); It's the default case I'm talking about (the other's will eventually go away). I've tried several different options for kicking off rptloader.jsp. It seams that when I go directly to rptloader.jsp, my session var is missing. What am I doing wrong? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
[ARTICLE] How Do I Use Jakarta Struts With JDeveloper
Struts and Oracle9i JDeveloper Here's a cool new article with detailed instructions on how to configure and use the Jakarta Struts open source Model-View-Controller framework with Oracle9i JDeveloper. http://otn.oracle.com/products/jdev/howtos/jsp/StrutsHowTo.html How Do I Use Jakarta Struts With JDeveloper.url Description: Binary data -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Reporting Solutions
often does that happen?! $1290 for 1 CPU, unlimited clients. See http://www.inetsoftware.de/English/scripts/FrameSetSub.asp?path=http://www.i netsoftware.de/English/Produkte/CrystalClear/Lizenzen/name=pricing_informat ion.htm. Besides missing one feature that one of our reports needs, the only other problem I've found is that it doesn't prompt for parms used in only in formulas. You can work around that though by putting the parm on the report setting it's format option to suppressed. HTH. Feel free to ask questions. Brad Rhoads Zethcon Corporation -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Protecting PDF and other non-jsp files
In my .jsp pages I can check if a session var has been set to determin if a page can viewed or not. How can I protect .pdf and other types of files (in an OS-independent way)? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Java Website ISP
FWIW - High end providers, at least in the windoz world, get that every month. So $350 for a year sounds pretty good to me. -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Friday, June 07, 2002 9:26 AM To: Struts (E-mail); Servlets (E-mail); J2ee (E-mail) Subject: Java Website ISP I fired my ISP yesterday for refusing to support server-side Java and am now actively looking at alternatives. I was surprised to find that there are only about 70 ISPs in the US supporting server-side Java. The good news is that most use Tomcat 3.2 on Apache and support JDK 1.3.1, Servlet 2.2 and JSP 1.1 with access to MySQL, and all that I have contacted are planning to upgrade to Tomcat 4.0x, JDK 1.4, Servlet 2.3 and JSP 1.2 within the next 8 weeks. One (SpinWeb.com) even will let you upload your own versions of Tomcat and JDK. The bad news is prices range from $350/year to $750 and I have no qualitative anecdotes regarding the level of service any provide. If anyone has first-hand knowledge of same, I'd appreciate the information. I want to make a decision in the next couple of hours so I can (hopefully) get the new DNS IPs propagated by tomorrow night. Thanks, Mark -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: .JSP / .ASP Integration
Well he could use a database to save the session info. -Original Message- From: Jimenez Daniel [mailto:[EMAIL PROTECTED]] Sent: Friday, June 07, 2002 9:03 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: .JSP / .ASP Integration Good luck! Your only solution is passing XML data. ALL ASP and JSP process on the server side in their own instances which are oblivious to each other. Thus session information cannot be shared. Dan [EMAIL PROTECTED] 6/7/02 8:17:23 AM Hi All, This is WAY off topic, but seeing that there are a couple of ex-ASPer's on the mailing list, I thought I'd throw this out and see if anyone can point me in the right direction. The company I work for has several, somewhat autonomous, development groups doing web development. Some (most) are using .ASP with either VB or C++. As part of my role, I have been tasked with developing a framework that can take all of our current websites and integrate them under a single 'look and feel' - including implementing a 'single sign-on' function. Obviously I chose JAVA and JSP with struts or I wouldn't be here. Anyway, I've got the authentication/authorization piece working, and can generate custom nav bars by user based on a persistent profile stored in an Oracle database. As long as the applications that I link to are Java/JSP based, I can pass around a set of JavaBeans containing the users information without any problem. How do I get this information over to a .ASP app? Can this even be done? Short of passing around XML data structure ala web services, I can't seem to find an easy (or hard) way to do this. Am I simply screwed? Thanks in advance. Everyone on the mailing list has been extemely helpful over the past few weeks, and I want to express my appreciation for all of the help. Jerry Jalenak [EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at (800)388-4675. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: New to Struts
I've been using Forte CE w/ struts 1.0. Works OK, but I haven't gotten the debugger going yet. And I have the .java .class files in the same directories. I know you can set up to compile to different directories, but I haven't taken the time to figure it out yet. -Original Message- From: Vincent Stoessel [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 29, 2002 11:08 AM To: Struts Users Subject: New to Struts Hello, I have been using forte CE as my main IDE for developing my java and jsp applications. The concept behind struts sounds great as I want to move toward a more standand templates/framework for my web based applications. My taglib experience has been very small and my EJB experience is still in the book reading phase. Does forte CE work well with struts or am I better off just using xemecs/jde to edit files by hand. Thanks. -- Vincent Stoessel Linux Systems Developer vincent xaymaca.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: How to Generate .xls file from struts app.
If you're running an NT server, you can use COM. See http://www.infozoom.de. -Original Message- From: Heath Chiavettone [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 04, 2002 8:17 PM To: 'Struts Users Mailing List' Subject: RE: How to Generate .xls file from struts app. We did this in our application and we found out just how limited Excel's HTML conversion capability is. It doesn't understand stylesheet styles, it sometimes blows up if images are referenced in the html, etc... We are looking into POI as a solution. -Original Message- From: Gruner, Manfred [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 04, 2002 2:50 AM To: 'Struts Users Mailing List' Subject: RE: How to Generate .xls file from struts app. Hi, you don't have to generate csv-files take the html-Code itself, and change the mime type to application/vnd.ms-excel. This should work too. Manfred -Original Message- From: Jim Crossley [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 02, 2002 4:34 PM To: Struts Users Mailing List Subject: Re: How to Generate .xls file from struts app. gvn [EMAIL PROTECTED] writes: I would like to generate a .xls (excel) file data from a result set. =20 What I have to do ?=20 One simple approach is to generate a CSV (Comma-Separated-Values) file instead, and then set the response's content type to application/vnd.ms-excel. That way, you exploit the fact that Excel transparently handles CSV files and rely on the browser to invoke Excel. Your action amounts to something not quite as trivial as this: PrintWriter out = response.getWriter(); while (youHaveRows) while (youHaveColumns) out.print(yourCell+,); out.close(); response.setContentType(application/vnd.ms-excel); -- Jim Crossley http://www.lads.com/~jim -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Page wrapper element?
The struts-template example does just that. It's part of the struts download. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 21, 2002 12:30 PM To: [EMAIL PROTECTED] Subject: Page wrapper element? Hi, I was wondering if anyone has some pointers on how to create sort of a 'page wrapper' with struts. I figure someone has tried something like this before All of my pages have the same layout: __ | header | |__| || | || | |navi| page body | || | || | || | ||_| | footer | |__| The only item that is different from page to page is the 'page body' portion. I'd like to avoid having the table structure and three includes (header, navi, and footer) for each .jsp I create. It would be much better if I could do something like: pagewrapper: page body stuff in here. /pagewrapper Is there anything out there already that does something like this? Thanks in advance, Eric. ** This message, including any attachments, contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, please contact sender immediately by reply e-mail and destroy all copies. You are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. TIAA-CREF ** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts w/Tomcat, I know this is a dumb question but
Yep, it works. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 19, 2002 11:50 AM To: Struts Users Mailing List Subject: Struts w/Tomcat, I know this is a dumb question but I am getting a new computer in 2 weeks for home use. I plan to develop an application using Struts and would like to use Tomcat 4.0 I don't want Windows XP installed so they're installing Windows 2000 instead. Does Tomcat 4.0 run under Windows 2000?I spent about 15-20 minutes at apache.org and could not locate a page that had the system requirements : -)I am using Tomcat 4.0 with Windows NT here at work with no problem but wanted to make sure it would run under Windows 2000? I 'understand' anything that runs under NT will run under 2000 but I wanted to make sure :-) thanks... -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
[RE: Redirecting to login page when session expires
I assume you mean processActionPerform; I don't see perform() in the ActionServlet. Here's what I ended up with and it works well: protected ActionForward processActionPerform(Action action, ActionMapping mapping, ActionForm formInstance, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException { HttpSession session = request.getSession(); String path = processPath(request); User user = (User)session.getAttribute(Constants.USER_KEY); if (user == null !path.equalsIgnoreCase(/LOGON)) { ActionForward logonForward = findForward(logon); return logonForward; } else return super.processActionPerform(action,mapping,formInstance,request,response); } Now I wan't to use the same technique at the top of my .jsp pages. In particluar, I wan't to test for a timeout and then direct the user to the logon page via the normal processes flow. We have a site template doing response.redirect bypasses the logic that includes the template info. So my question is how can I do an ActionForward from a .jsp? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jim Crossley Sent: Sunday, March 17, 2002 7:46 AM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: Redirecting to login page when session expires Hi Tony. Tony Li [EMAIL PROTECTED] writes: What's the most elegant way of redirecting the user to the login page after his session expires within struts? Here's a simple approach: Override the ActionServlet's perform method to check the session for something that your login action should've put there. If it's there, return super.perform(). If it's not, return findForward(login), assuming you have a global forward in your struts-config called login. A more elegant approach might involve the use of a filter (Servlet 2.3) instead of an ActionServlet derivation, but the idea of looking in the session for something indicating a successful login is the same. -- Jim Crossley http://www.lads.com/~jim -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
calling processActionForward from processesPreprocess in struts 1.0.2 timeout checking
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg15542.html suggests calling processActionForward from unauthenticatedUser, which is called from processesPreprocess, to handle timout checking. But in the stable release processActionForward needs an ActionMapping parm. So I change the example code to this: private void unauthenticatedUser( HttpServletResponse iResponse, HttpServletRequest iRequest, String iRequestedPage) throws IOException, ServletException { HttpSession session = iRequest.getSession(); ActionErrors errors = new ActionErrors(); // redirect to the login servlet (passing parameter) String path = processPath(iRequest); this.log( User is not logged on in session + session.getId()); /*errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(error.notloggedin)); saveErrors(iRequest, errors);*/ ActionForward logonForward = findForward(logon); ActionForward forward = new ActionForward(logonForward.getPath(), true); //forward.setPath(forward.getPath() + ?page= + iRequestedPage); processForward(processMapping(path,iRequest), iRequest, iResponse); } This function is being called when a timout occurs, but the forward to my logon page never happens. I just get a plain white screen. (The address bar shows me the name of last screen I was on.) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
User Overrideable Errors
In the action for form1 I detect several errors and warnings; the user should be able to ignore warnings, but is required to fix errors. My question is what's the best way to implement warnings in struts. The main issue is how do I show the user the warnings on his first try, but move on to the success step after the second submit of the form (assuming all the errors have been taken care of). In the days before struts, I would probably would have passed a flag in the query string or as a hidden field. But it seems like this should be done by struts. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Usage of Action Tokens - preventing application 'damage' by impatient users
You can prevent multiple submits in the client side using JavaScript. Below is some code that you can see in action at https://www.cyclewacko.com/ChangeInfo.asp?mode=newGoTo=youraccount.aspSSL= yes //-- /SCRIPTSCRIPT language=JavaScript type=text/JavaScript !-- //This include file contains some JavaScript functions to prevent users //from submitting a form twice. It sets a flag (FormSubmitted) to false //when the page first loads. Then, when the form is submitted, this flag //is checked. If it is true, it tells the user that they have already //submitted the form and prevents the second submission. If it is false //it toggles the flag true (which prevents the next submission) and //submits the form. The flag can be reset if subsequent submissions are //required. One example would be if the user changes information on the //form and then re-submits. In this case, the ResetFormSubmitted function //should be called in the onChange event of any form item that can be //changed. //Initialize the FormSubmitted variable var FormSubmitted = false; function DoubleSubmitCheck() //Call this function in the form's onSubmit attribute { //Check if the form has previously been submitted if(FormSubmitted) //It was { //Alert the user and cancel the submission alert(You have already submitted this form. Please wait for it to be + processed...\n\nNOTE: If you pressed your browser's 'Stop' button + after submitting this form, you'll have to press the 'Reload' or + 'Refresh' button before you can re-submit.) return false; } else //It was not (this is the first time it was submitted { //Set the FormSubmitted flag to true and return true to process the form FormSubmitted = true; return true; } } -Original Message- From: Tom Bednarz [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 28, 2002 11:09 AM To: struts user list Subject: Usage of Action Tokens - preventing application 'damage' by impatient users Hi, I guess it is a common problem of web applications that they need to track how many times a user clicks a submit button. Assuming, that a click on the submit button executes an expensive stored procedure on a database server which may take 10 to 20 seconds, lots of users get impatient and click the submit button again and again. I tracked this down and noticed, that every click executes the perform method of my Action class. In fact the server executes the procedure as many times as the user clicks the button. In the struts framework I found in the Action class the following methods: generateToken(), isTokenValid(), resetToken() and saveToken() Could anybody explain how and where to use these methods best to prevent an action from executing multiple times? I see the following processing inside the action.perform() method: 1) getParameters from the form 2) determine whether the form needs first to be delivered or the user input needs to be processed if user input needs to be processed continue with 3) otherwise deliver the form... 3) validate the parameters 4) process request 5) catch any errors and return them (if there are any) 6) deliver the results by forwarding to a view template In my opinion the steps 3 to 5 should be treated like a transaction and any further submits from the same session should not be processed. Could anybody please post an exemple how to solve that problem best? Many thanks Thomas -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
[OT] Problem calling stored proc in Oracle 8.0
I'm trying to call the following stored proc: PROCEDURE cancel_order_request (in_orderid IN number ,in_shipid IN number ,in_facility IN varchar2 ,in_source IN varchar2 ,in_userid IN varchar2 ,out_msg IN OUT varchar2 ) which I can call successfully when pointing to an Oracle 8i database (using the 8i driver), but I get the following error when using the same database running under Oracle 8.0 (using the 8.0 driver): java.sql.SQLException: ORA-01460: unimplemented or unreasonable conversion requested I have the same problem with another proc. The only difference I can see between the ones that work and these two that don't is the ones that don't work have IN OUT parms (e.g. out_msg). Here's the code that calls the proc: private static String cancelOneOrder(String orderID, String sFacility, String reason, String sLogin, String sShipID){ // int theLoad = getOrdLoad(orderID); long shipId = Integer.parseInt(sShipID); //String sFacility = getOrdFacility(orderID); String outMsg = ; String sSQL = null; Connection cConnection = null; CallableStatement cs = null; System.out.println(Cancel ORDER: + orderID ); try cConnection = dataSource.getConnection(); try { cs = cConnection.prepareCall({call zorderentry.cancel_order_request(?,?,?,?,?,?)} ); //cs.setBigDecimal(1,BigDecimal.valueOf(Long.parseLong(orderID))); //cs.setBigDecimal(2, BigDecimal.valueOf(shipId)); // cs.setInt(1,Integer.parseInt(orderID)); //cs.setInt(2,Integer.parseInt(sShipID)); cs.setLong(1,Long.parseLong(orderID)); cs.setLong(2,Long.parseLong(sShipID)); cs.setString(3,sFacility); cs.setString(4,WEB); cs.setString(5,sLogin); cs.registerOutParameter(6, Types.VARCHAR); cs.executeUpdate(); }catch(Exception e) {System.out.println(RS);System.out.println(e);} ResultSet rs = cs.getResultSet(); outMsg = cs.getString(6).trim(); cs.close(); }catch(Exception e) {System.out.println(e);} System.out.println(OUTMSG: + outMsg); return outMsg; } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Mark Woon Sent: Friday, February 15, 2002 3:37 PM To: Struts Users Mailing List Subject: Re: [OT] Poolman problem Mikkel Bruun wrote: do you know where i can get a more stable build then??? Same place you got 2.1b1: http://www.codestudio.com. Another connection pool implementation: http://www.bitmechanic.com/projects/jdbcpool/. -Mark -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Reloading a page without refreshing Remote Scripting)
I did remote scripting in the ASP world. I haven't heard of it being used in the JSP world, but I haven't been around that long. Anyway, one time remote scipting is used is for dependent list boxes. For example after the user selects a country from one drop down list, the state/prov dropdown list is then populated w/ the appropriate data. An alternative to remote scripting in this case is to use JavaScript. All the data has to be pre-loaded into arrays, but then you can dynamicly populate dropdowns on the client side. Note too that remote scripting doesn't work w/ all browsers. I think we had to take the JavaScript approach w/ Mac browers. For an example, see http://www.cyclewacko.com. -Original Message- From: Rao, Sarveswara [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 10:14 AM To: 'Struts Users Mailing List' Subject: Reloading a page without refreshing Remote Scripting) Hi I have to developed a Page in which user enters the Zip Code and fields like City Name, State Name have to be populated without refreshing the page. I have found one solution Called 'Remote Scripting'. But that does not seem to work. Can any one have any experience with Remote Scripting. Please Help me. Thanks Rao -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
[OT] Publishing an Application
I'm looking for a good tool for publishing an application. It should compare the source directory to the target and only move files that have changed. I'd also like an option to skip certain files, i.e. web.xml. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: [OT] Publishing an Application
That looks like what I need except I didn't find a build for NT. I found an old note about compiling the source that said the app may or may not actually work when recieving files on NT. -Original Message- From: Dave Weis [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 05, 2002 10:00 AM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: [OT] Publishing an Application On Tue, 5 Feb 2002, Brad Rhoads wrote: I'm looking for a good tool for publishing an application. It should compare the source directory to the target and only move files that have changed. I'd also like an option to skip certain files, i.e. web.xml. I use rsync, it's fast and has quite a bit of intelligence. dave -- Dave Weis I believe there are more instances of the abridgement [EMAIL PROTECTED] of the freedom of the people by gradual and silent encroachments of those in power than by violent and sudden usurpations.- James Madison -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Connection Pooling
Does anyone know of any connection pooling solution that will work with any version of any database and with any application server? We found out we need to support Oracle 8.0 and the 8.0 drivers don't support JDBC 2.0 (please correct me if I'm wrong on this) so I was planning to put in PoolMan, but I also need the app to work in WebSphere. -Original Message- From: Andrew Myers [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 7:50 PM To: [EMAIL PROTECTED] Subject: Re: Connection Pooling I did give this a try although I had a few hassles getting it running in the Visual Age 4.0 and the WebSphere Test Environment (the lazy instantiation didn't seem to work on the first attempt and I always had to reload my pages to see the data?). Has anyone successfully used this in WTE? Thanks, Andrew. - Original Message - Subject: Re: Connection Pooling Date: Wed, 30 Jan 2002 20:32:08 -1000 From: cahana [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Have you tried Poolman to do your connection pooling? It provides a way to specify a validation query which periodically checks to see if the database is still accessible. If it doesn't, it'll keep trying to connect to the database until it comes back up. The url is www.codestudio.com -- __ Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/ Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Connection Pooling
That link was to info mostly about 8i (Build 8.1.7). I need it work w/ Build 8.0.5. I followed a link to JDBC Driver-Database Compatibility and found this info which I don't totally understand: * Different JDKs require different class files--classes in classes12.zip, classes111.zip, and classes102.zip, respectively * Note: the JDBC server-side internal driver is not available for 8.0.x and prior versions. * The JDBC drivers do not support structured objects when run against an 8.0.x database. This is because JDBC depends on PL/SQL functions that did not exist in those releases. And just be clear, what I'm concerned about is connection pooling I want the same code to work for both 8.0 8i. So, does the JDBC Driver-Database Compatibility info say that I just need to use a different class file, say classess111, or that I can't do what I want w/ 8.0 or ??? -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Friday, February 01, 2002 10:00 AM To: 'Struts Users Mailing List' Subject: RE: Connection Pooling You are wrong on this. Oracle 8 drivers definitely support Java 2.0 and JDBC 2.0. Perhaps you have the wrong driver? http://otn.oracle.com/docs/products/oracle8i/doc_library/817_d oc/java.817/a8 3724/overvw5.htm#1000974 Mark -Original Message- From: Brad Rhoads [mailto:[EMAIL PROTECTED]] Sent: Friday, February 01, 2002 10:00 AM We found out we need to support Oracle 8.0 and the 8.0 drivers don't support JDBC 2.0 (please correct me if I'm wrong on this) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Connection Pooling
So I'm back to my original question: is there a 3rd party connection pool, e.g. PoolMan, that works in general, for any version of any db and in any app server? Thanks for the help. I'll check out the other list too. -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Friday, February 01, 2002 10:41 AM To: 'Struts Users Mailing List' Subject: RE: Connection Pooling Looks like you're screwed. I haven't used anything but 8i and SQL Server 7/2000 for over 2 years. If you can't get any solid info from Oracle or this list, scoot over to [EMAIL PROTECTED] and ask those guys. You can signup at (somewhere) java.sun.com/products/jdbc/ Mark Now, to get back to the Great Reference Debate for today, is an object passed via RMI by value or reference? ;-)~ -Original Message- From: Brad Rhoads [mailto:[EMAIL PROTECTED]] Sent: Friday, February 01, 2002 11:21 AM That link was to info mostly about 8i (Build 8.1.7). I need it work w/ Build 8.0.5. I followed a link to JDBC Driver-Database Compatibility and found this info which I don't totally understand: * Different JDKs require different class files--classes in classes12.zip, classes111.zip, and classes102.zip, respectively * Note: the JDBC server-side internal driver is not available for 8.0.x and prior versions. * The JDBC drivers do not support structured objects when run against an 8.0.x database. This is because JDBC depends on PL/SQL functions that did not exist in those releases. And just be clear, what I'm concerned about is connection pooling I want the same code to work for both 8.0 8i. So, does the JDBC Driver-Database Compatibility info say that I just need to use a different class file, say classess111, or that I can't do what I want w/ 8.0 or ??? -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Friday, February 01, 2002 10:00 AM To: 'Struts Users Mailing List' Subject: RE: Connection Pooling You are wrong on this. Oracle 8 drivers definitely support Java 2.0 and JDBC 2.0. Perhaps you have the wrong driver? http://otn.oracle.com/docs/products/oracle8i/doc_library/817_d oc/java.817/a8 3724/overvw5.htm#1000974 Mark -Original Message- From: Brad Rhoads [mailto:[EMAIL PROTECTED]] Sent: Friday, February 01, 2002 10:00 AM We found out we need to support Oracle 8.0 and the 8.0 drivers don't support JDBC 2.0 (please correct me if I'm wrong on this) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Struts (Examples) Compilation Requirements
I'm trying to compile the Struts examples, but I'm getting all kinds of errors. (The provided classes are running OK, so I've done something right :). I just put all the .war files in the webapps dir restarted tomcat.) I'm looking for as detailed instructions on what I need to do/have installed, etc. as possible. I'm fairly new to Linux, Java, Struts so I'm looking for as close to a cookbook as I can find. I do have 2 specific questions though: First: what needs to be in the CLASSPATH? Second: There are some javax libs being used. I can't figure where to find them. Apparently they're not installed as part of the standard SDK Thanks for the help.
RE: Struts (Examples) Compilation Requirements
I tried compiling under Window and got similar results. I'm not sure what I was compiling when I got the javax problem, but here's (the beginning) of what I get when compiling User.java from the struts-example: From with in this directory: c:\jakara-tomcat-3.2.1\webapps\struats-example\web-inf\src\apache\struts\web app\example I type: javac User.java and get: User.java:234: cannot resolve symbol symbol : class Subscription location: class org.apache.struts.webapps.example.User public Subscription findSubscription(String host) . . . I assume the root problem is the compiler isn't finding struts.jar, but I put it the classpath environment var I've also tried javac -classpath c:\jakara-tomcat-3.2.1\webapps\struats-example\web-inf\lib\struts.jar User.java. -Original Message- From: Jeff Oberlander [mailto:[EMAIL PROTECTED]] Sent: Friday, January 25, 2002 3:44 PM To: 'Brad Rhoads' Subject: FW: Struts (Examples) Compilation Requirements I'm using Tomcat (but on windows). It should just nicely work. The classpath is all self contained in the war. Which javax classes can't it find? There might be a problem with your Tomcat installation. Give me more specifics and I'll try to help. -Original Message- From: Brad Rhoads [mailto:[EMAIL PROTECTED]] Sent: Friday, January 25, 2002 1:17 PM To: [EMAIL PROTECTED] Subject: Struts (Examples) Compilation Requirements I'm trying to compile the Struts examples, but I'm getting all kinds of errors. (The provided classes are running OK, so I've done something right :). I just put all the .war files in the webapps dir restarted tomcat.) I'm looking for as detailed instructions on what I need to do/have installed, etc. as possible. I'm fairly new to Linux, Java, Struts so I'm looking for as close to a cookbook as I can find. I do have 2 specific questions though: First: what needs to be in the CLASSPATH? Second: There are some javax libs being used. I can't figure where to find them. Apparently they're not installed as part of the standard SDK Thanks for the help. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]