RE: session time-out in pop-up windows
You'd have to find a way to identify the popup. It could be because of the requested resource (myPopup or any page with popup) or a special request parameter which will only be sent by a request for a popup window (href='/mycontext/myinfodisplay.do?myActualParam=1isPopup). Either way, the filter will have to be notified somehow that Hey, this particular request here is a popup! When it does, then you can redirect the popup to a different page which does nothing but send the parent to a different url and close itself. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, November 03, 2003 9:10 AM To: [EMAIL PROTECTED] Subject: RE: session time-out in pop-up windows Hubert Thanks for this. But how would filter recognise that the request was sent by a popup? As I understand, the process is like: - pop-up window opens - Page would read global forward url from the struts config file (the page to display) - It will check filter: if filter pass is true display url page else display error page. So I am not sure, how Step 3 and then 4 could be implemented. -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: 03 November 2003 14:50 To: Struts Users Mailing List Subject: Re: session time-out in pop-up windows Another way might be: 1. user clicks link for pop-up window, window pops-up and initiates the web request 2. Filter intercepts the request and senses that the session has timed out 3. Before redirecting, filter recognizes that the request was sent by a popup, and instead redirects to a different pop-up page 4. The session-expired pop-up window shows in the browser with JS code to (a) redirect the parent page to the login window and (b) close itself. --- [EMAIL PROTECTED] wrote: I am using Filters to determine whether session has timed out or no and redirect user to login page. The implementation class extends Action class so you could display appropriate messages on login page when user gets redirected to it due to time out. However this does not work well when there are pop-up windows: e.g. When user clicks on a hyperlink in a parent browser window, a new pop-up window opens to display information. But when the session has timed out, the pop-up window displays session time out error and redirects it log in page. What I intend to achieve is that when the user clicks on the hyperlink and if the session has expired new pop-up window does not open and is the redirected to login page in the parent browser window itself. One possibility is to associate the hyperlink on the page with a form submission and then verify session time out in Action class but then how to open pop-up window from within Action class? Any other possibilities? Any suggestions/pointers will be much appreciated. Regards Chinmay - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: problem whith saveMessages
I do this my passing the message as a parameter, having the RequestProcessor intercept it, and re-save in the request scope. -Original Message- From: Adrian Baisch [mailto:[EMAIL PROTECTED] Sent: Thursday, October 30, 2003 9:36 AM To: [EMAIL PROTECTED] Subject: problem whith saveMessages Hi, I have a question I'd like to ask: I have a ConfirmationAction that sets up some success messages using: messages.add(new ActionMessage(timesheetManage.save.success)); saveMessages(request, messages); And upon this save, the findForward(success) forwards to another action class with: forward name=success path=/do/confirmation.jsp redirect=true / But on the JSP after, there are no messages displayed. I know the answer why, and that is because redirect=true. However, this is the only way I can forward to another action class in iPlanet. But on the JSP after, there are no messages displayed. I know the answer why, and that is because redirect=true. Anyone know of a workaround to carry these messages into the next page? Any suggestions? Thanks in advance - 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 whith saveMessages
I have an object which I use to collect parameters. Let's call this RedirectParameters.Among the parameters it knows to collect (String, int, etc) are ActionMessage and ActionError objects. When I pass it a message, it expands the message and adds it as a URL. The RedirectParameters gets saved in the request scope. (Another option is to extend ActionForward to handle this, and return a new instance of this subclass instead of mapping.findForward().) In my RequestProcessor, I check if the forward is for a redirect (forward.getRedirect() returns true), and if so, I get the RedirectParameters from the request scope and form my URL parameters. ActionMessage and ActionError messages are given a unique parameter to avoid conflicts (com.mycompany.myapp.something). I append this to the URL passed to response.sendRedirect(). Also in my RequestProcessor, I check for the unique request parameters, and when they are present, I instantiate ActionMessage and ActionError objects as appropriate and save them in the request scope so it gets handled as usual. To summarize: 1. I see I need a redirect, so I collect my parameters 2. Before my RequestProcessor calls sendRedirect(), it collects the parameters and appends them to the URL 3. When my RequestProcessor processes a ForwardConfig, it checks for request params designated to ActionMessage and ActionError messages, and stores them in the request scope where the JSP or Action object can access them like other messages/errors. -Original Message- From: Adrian Baisch [mailto:[EMAIL PROTECTED] Sent: Thursday, October 30, 2003 10:07 AM To: Struts Users Mailing List Subject: RE: problem whith saveMessages I do not understand, you can offer me but details, Thanks . At 12:48 30/10/2003, you wrote: I do this my passing the message as a parameter, having the RequestProcessor intercept it, and re-save in the request scope. -Original Message- From: Adrian Baisch [mailto:[EMAIL PROTECTED] Sent: Thursday, October 30, 2003 9:36 AM To: [EMAIL PROTECTED] Subject: problem whith saveMessages Hi, I have a question I'd like to ask: I have a ConfirmationAction that sets up some success messages using: messages.add(new ActionMessage(timesheetManage.save.success)); saveMessages(request, messages); And upon this save, the findForward(success) forwards to another action class with: forward name=success path=/do/confirmation.jsp redirect=true / But on the JSP after, there are no messages displayed. I know the answer why, and that is because redirect=true. However, this is the only way I can forward to another action class in iPlanet. But on the JSP after, there are no messages displayed. I know the answer why, and that is because redirect=true. Anyone know of a workaround to carry these messages into the next page? Any suggestions? Thanks in advance - 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: Multiple message-resources -- How to access? Struts 1.1
I'm worried about getting the same problem, except I don't want to go back into all my components to add key parameters later on. Is there a way to break down a huge global properties file into several files which all get added to the global resources? Is this a feature worth asking for/working on? -Original Message- From: Lukas Bradley [mailto:[EMAIL PROTECTED] Sent: Thursday, October 30, 2003 10:26 AM To: [EMAIL PROTECTED] Subject: Multiple message-resources -- How to access? Struts 1.1 Hi all, I feel rather odd asking about this, because it seems it should be a VERY simple task. I've been using a single message-resource within my struts-config.xml file. It's been working beautifully defined as: message-resources parameter=MyTerms null=false/ When I have a file MyTerms.properties in my /WEB-INF/classes directory. I access my properties as such: bean:message key=label.forum.subject / And everything the world is perfect. Except that my properties file has filled up with hundreds of terms, and it is getting impossible to manage. To make this easier, I decided to define multiple message-resources in my struts-config. message-resources parameter=MyTerms null=false/ message-resources parameter=msg.resource.errors key=msg.errors null=false / message-resources parameter=msg.forum key=msg.forum null=false / It is my understanding that the initial MyTerms file will be stored under the default resources property, and the other two will be stored as msg.errors and msg.forum respectively. However, when I try to access them, I get nothing. bean:message key=label.forum messages=msg.forum/ bean:message key=label.forum name=msg.forum/ bean:message key=label.forum bundle=msg.forum/ None of the tags above work. I even tried bean:message property=label.forum bundle=msg.forum/ But that gives a NullPointerException. So I'm stumped. In the logs, the property file is being loaded during startup, and my default property file still returns messages. Any help? Lukas - 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] javascript question...
What error were you getting here? -Original Message- From: Jacob Wilson [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2003 3:44 PM To: Struts Users Mailing List Subject: RE: javascript question... Thanks Narayanan -- I tried this b4, but this will throw an error... Actually, you need to pass a total string into the open method Prashanth Narayanan [EMAIL PROTECTED] wrote: try var newwin=window.open(a.html?Name=+namVal); -Original Message- From: Jacob Wilson [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2003 4:37 PM To: [EMAIL PROTECTED] Subject: javascript question... Hi... Is it possible to send a value of a form element from the parent window to the child window like this??? function go() { var namVal = document.fm1.txtName.value; var newwin=window.open(a.html?Name=namVal); } [input] [input] The above does not work... it will give me 'namVal' as the value rather than the actual typed in value when I try to get request.getParameter How can I achieve this functionality??? I need to pass a form element value when opening a new window. This value is essential at this point coz I perform an action based on this value and then bring the pop up page Suggestions requested please... Thanks! Jacob - Do you Yahoo!? Exclusive Video Premiere - Britney Spears - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Exclusive Video Premiere - Britney Spears - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Please help: Cannot find message resources under key org.apache. struts.action. MESSAGE
And delete the .properties from struts-config: struts-config message-resources parameter=ApplicationResources/ /struts-config -Original Message- From: Edgar P Dollin [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2003 3:58 PM To: 'Prashanth Narayanan'; 'Struts Users Mailing List' Subject: RE: Please help: Cannot find message resources under key org.apache. struts.action. MESSAGE Looks like you need a file ApplicationResources.properties in your /WEB-INF/classes directory. Edgar -Original Message- From: Prashanth Narayanan [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2003 4:57 PM To: 'Struts Users Mailing List' Subject: Please help: Cannot find message resources under key org.apache. struts.action. MESSAGE still couldn't resolve this any help will be appreciated - this is my first struts example! -Original Message- From: Prashanth Narayanan Sent: Wednesday, October 29, 2003 1:54 PM To: '[EMAIL PROTECTED]' Subject: Cannot find message resources under key org.apache.struts.action. MESSAGE hi, i am getting the following message: org.apache.jasper.JasperException: Cannot find message resources under key org.apache.struts.action.MESSAGE at org.apache.jasper.servlet.JspServletWrapper.service(JspServlet Wrapper.java:2 54) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet .java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) ... i am running struts 1.1 on apache 4.1. and this is the most basic example: -- my BookView.jsp -- %@ page language=java % %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic % html:html locale=true head html:base/ title bean:message key=index.title/ /title /head body h2BookView/h2 /body /html:html -- from my web.xml: -- web-app servlet servlet-nameaction/servlet-name servlet-classorg.apache.struts.action.ActionServlet/servlet-class init-param param-nameapplication/param-name param-valueApplicationResources/param-value /init-param init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param my struts-config.xml: ?xml version=1.0 encoding=ISO-8859-1 ? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.0//EN http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd; struts-config message-resources parameter=ApplicationResources.properties/ /struts-config any help will be much appreciated, thanks, -prash. - 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: Problems changing packages
Also remember to delete the folder for your web app in Tomcat. [TOMCAT_HOME]/webapps/your_web_app -Original Message- From: Geeta Ramani [mailto:[EMAIL PROTECTED] Sent: Thursday, October 23, 2003 10:58 AM To: Struts Users Mailing List Subject: Re: Problems changing packages Importance: Low Steve: Did you try a (clean) rebuild of everything? Worth a shot.. Geeta Zimmerman, Steven R. wrote: This is nuts that I can't seem to find any information on this in the archives, s... I must be doing something wrong, as nobody else seems to have this problem. My problem is when I move my Form and Action source files to different packages I am receiving an error when I run them in my Tomcat container. Specifically the error is Exception creating bean of class xxx. Everything works fine prior to this change. I have changed the form-bean type definition and the action type definition in the struts-config to point at the new package structure but to no avail. There must be something else to change??? I have tried changing some other items but seem to get farther from the problems... TIA, Steve (aka Chasing my tail) - 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: accessing static html from struts-config.xml
Try adding a 'redirect=true' in your original forward. You can also try specifying a complete path to the static resource, still with the redirect. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 1:28 PM To: [EMAIL PROTECTED] Subject: RE: accessing static html from struts-config.xml No the reference to the path in the forward section does not work. I am not sure how to use the response.redirect method. Do we put this method in the execute method of the LogoffAction? or do we make a new method called public void redirect(HttpServletRequest){ response.redirect(http://localhost/xyz.html;); } I believe that you are not forced to use a relative URL. You can put http://www.mysite.com/index.html; as the Forward path and it should work just fine. If, for whatever reason, the Forward to an absolute URL does not work, you can always use response.redirect(actionForward.getPath()) in your Action while returning a null ActionForward -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 12:58 PM To: [EMAIL PROTECTED] Subject: accessing static html from struts-config.xml Hi All I am trying to do a logoff action.When the user logsoff he should be taken to the main website which is under /var/www/html/blah/index.shtml which is completely out of the tomcat and this is where i have stored the static content of the website. I do not understand how to write this forward in my struts-config.xml forward name=xyzhome path=../blah.shtml / does not do anything or can i specify a URI to access the resource. Thanx --Mohan - 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: accessing static html from struts-config.xml
or use forward name=home path=http://www.mysite.com; redirect=true/ which would do the same thing. -Original Message- From: Turansky, Mark [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 1:46 PM To: Struts Users Mailing List Subject: RE: accessing static html from struts-config.xml I just tried (and failed) using a fully qualified URL as the ActionForward. The exception told me that my path did not start with a / So here is an action that will use a redirect instead of an ActionForward. This works: /** * a simple action to invalidate a session and return * the user to the home page */ public class LogoffAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response){ request.getSession().invalidate(); ActionForward foward = mapping.findForward(home); String path = forward.getPath(); response.sendRedirect(path); return null; } } the corresponding struts-config entry global-forwards forward name=home path=http://www.mysite.com; / /global-forwards NOTE! when you retrieve this ActionForward through the ActionMapping object, it will FAIL if you try to return it from the execute() method. It fails because a fully qualified URL won't work in the ActionForward. You can use the Forward home to store the fully-qualified URL (and retrieve it via forward.getPath()) or you can put that in some other property section or config file. Either way, you can use response.sendRedirect(str) to send the user to any website you wish, including your own home page. I hope this helps. mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 2:28 PM To: [EMAIL PROTECTED] Subject: RE: accessing static html from struts-config.xml No the reference to the path in the forward section does not work. I am not sure how to use the response.redirect method. Do we put this method in the execute method of the LogoffAction? or do we make a new method called public void redirect(HttpServletRequest){ response.redirect(http://localhost/xyz.html;); } I believe that you are not forced to use a relative URL. You can put http://www.mysite.com/index.html; as the Forward path and it should work just fine. If, for whatever reason, the Forward to an absolute URL does not work, you can always use response.redirect(actionForward.getPath()) in your Action while returning a null ActionForward -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 12:58 PM To: [EMAIL PROTECTED] Subject: accessing static html from struts-config.xml Hi All I am trying to do a logoff action.When the user logsoff he should be taken to the main website which is under /var/www/html/blah/index.shtml which is completely out of the tomcat and this is where i have stored the static content of the website. I do not understand how to write this forward in my struts-config.xml forward name=xyzhome path=../blah.shtml / does not do anything or can i specify a URI to access the resource. Thanx --Mohan - 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]
RE: accessing static html from struts-config.xml
Sorry but I don't have any experience with mod_jk2. Accd to the code, the redirect will prepend the redirect url if the path starts with /: From RequestProcessor.processForwardConfig(): String forwardPath = forward.getPath(); String uri = null; // paths not starting with / should be passed through without any processing // (ie. they're absolute) if (forwardPath.startsWith(/)) { uri = RequestUtils.forwardURL(request, forward);// get module relative uri } else { uri = forwardPath; } if (forward.getRedirect()) { // only prepend context path for relative uri if (uri.startsWith(/)) { uri = request.getContextPath() + uri; } response.sendRedirect(response.encodeRedirectURL(uri)); } else { doForward(uri, request, response); } Maybe someone else can answer why it behaves that way for you. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 3:29 PM To: [EMAIL PROTECTED] Subject: RE: accessing static html from struts-config.xml Ya i tried the same thing but see i have mod_jk2 as connector and my webapp context is actually usabo but i am calling it as /japps/usabo thro the connector, and when i attempt to access this forward, it give the following error japps/usabo/http:/www.mysite.com not found. No matter the forward appends the context to this path.I had to add the contexts and their paths in server.xml for the connector to work. Is that affecting it? or use forward name=home path=http://www.mysite.com; redirect=true/ which would do the same thing. -Original Message- From: Turansky, Mark [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 1:46 PM To: Struts Users Mailing List Subject: RE: accessing static html from struts-config.xml I just tried (and failed) using a fully qualified URL as the ActionForward. The exception told me that my path did not start with a / So here is an action that will use a redirect instead of an ActionForward. This works: /** * a simple action to invalidate a session and return * the user to the home page */ public class LogoffAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response){ request.getSession().invalidate(); ActionForward foward = mapping.findForward(home); String path = forward.getPath(); response.sendRedirect(path); return null; } } the corresponding struts-config entry global-forwards forward name=home path=http://www.mysite.com; / /global-forwards NOTE! when you retrieve this ActionForward through the ActionMapping object, it will FAIL if you try to return it from the execute() method. It fails because a fully qualified URL won't work in the ActionForward. You can use the Forward home to store the fully-qualified URL (and retrieve it via forward.getPath()) or you can put that in some other property section or config file. Either way, you can use response.sendRedirect(str) to send the user to any website you wish, including your own home page. I hope this helps. mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 2:28 PM To: [EMAIL PROTECTED] Subject: RE: accessing static html from struts-config.xml No the reference to the path in the forward section does not work. I am not sure how to use the response.redirect method. Do we put this method in the execute method of the LogoffAction? or do we make a new method called public void redirect(HttpServletRequest){ response.redirect(http://localhost/xyz.html;); } I believe that you are not forced to use a relative URL. You can put http://www.mysite.com/index.html; as the Forward path and it should work just fine. If, for whatever reason, the Forward to an absolute URL does not work, you can always use response.redirect(actionForward.getPath()) in your Action while returning a null ActionForward -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 12:58 PM To: [EMAIL PROTECTED] Subject: accessing static html from struts-config.xml Hi All I am trying to do a logoff action.When the user logsoff he should be taken to the main website which is under /var/www/html/blah/index.shtml which is completely out of the tomcat and this is where i have stored the static content of the website. I do not understand how to write this forward in my struts-config.xml forward name=xyzhome path=../blah.shtml / does not do