Re: Form handling by direct URL in Struts 1.3.8

2012-06-14 Thread Takanori Hayashi
PS In that case, forward to another JSP on that file userInfo information should not be used. (2012/06/15 9:10), Takanori Hayashi wrote: Hello Anjib, Assumed that you made the distinction on validate method, then if forwarded JSP page is using userInfo session like ${userInfo.use

Re: Form handling by direct URL in Struts 1.3.8

2012-06-14 Thread Takanori Hayashi
Hello Anjib, Assumed that you made the distinction on validate method, then if forwarded JSP page is using userInfo session like ${userInfo.userName} the same error is shown. [Caused by: javax.servlet.jsp.JspException: Cannot find bean: "userInfo" in any scope ] Because you are us

Re: Form handling by direct URL in Struts 1.3.8

2012-06-14 Thread Dave Newton
On Thu, Jun 14, 2012 at 9:18 AM, Anjib Mulepati wrote: > I don't think problem is mapping correct page from Action class. If you > look into my initial code posting /changepassword need form validation so > it calls the validate() method and since there is no data it fails. I have > input="change

Re: Form handling by direct URL in Struts 1.3.8

2012-06-14 Thread Anjib Mulepati
I don't think problem is mapping correct page from Action class. If you look into my initial code posting /changepassword need form validation so it calls the validate() method and since there is no data it fails. I have input="changePasswordPage" which takes to the tile where it look for the s

Re: Form handling by direct URL in Struts 1.3.8

2012-06-13 Thread Takanori Hayashi
Hello Anjib, [Error message] Caused by: javax.servlet.jsp.JspException: Cannot find bean: "userInfo" in any scope [Cause] If someone type direct URL http://localhost:8080/MyApp/changepassword.do, no userInfo in the session. Then userIsLoggedIn method returns false, return mapping.findForwa

Re: Form handling by direct URL in Struts 1.3.8

2012-06-13 Thread Anjib Mulepati
I am looking for such prevention measure. Right now for most action I have Base action where it check whether user has logged in or not. On 6/13/2012 1:21 PM, Dave Newton wrote: On Wednesday, June 13, 2012, Anjib Mulepati wrote: Where and how I do that? In Struts 1.2 you'd use a custom reque

Re: Form handling by direct URL in Struts 1.3.8

2012-06-13 Thread Dave Newton
On Wednesday, June 13, 2012, Anjib Mulepati wrote: > Where and how I do that? In Struts 1.2 you'd use a custom request processor (or just a filter). Not sure about 1.3. How are you preventing access to protected pages now? Dave

Re: Form handling by direct URL in Struts 1.3.8

2012-06-13 Thread Anjib Mulepati
Where and how I do that? On 6/13/2012 12:19 PM, Dave Newton wrote: Sure, redirect any request without a user info object to the login page. Dave (pardon brevity and typos, on cell) On Jun 13, 2012 12:16 PM, "Anjib Mulepati" wrote: i know that. My question was how we handle such direct URL.

Re: Form handling by direct URL in Struts 1.3.8

2012-06-13 Thread Dave Newton
Sure, redirect any request without a user info object to the login page. Dave (pardon brevity and typos, on cell) On Jun 13, 2012 12:16 PM, "Anjib Mulepati" wrote: > i know that. My question was how we handle such direct URL. Like in this > case. Is there any mechanism to prevent? > > On 6/13/2

Re: Form handling by direct URL in Struts 1.3.8

2012-06-13 Thread Anjib Mulepati
i know that. My question was how we handle such direct URL. Like in this case. Is there any mechanism to prevent? On 6/13/2012 12:07 PM, Jason Zheng wrote: That's the problem, when you type the URL directly, the LoginSubmitAction.execute() method will not be invoked, so the 'userinfo' is not ex

Re: Form handling by direct URL in Struts 1.3.8

2012-06-13 Thread Jason Zheng
That's the problem, when you type the URL directly, the LoginSubmitAction.execute() method will not be invoked, so the 'userinfo' is not exits in any scope. On Wed, Jun 13, 2012 at 11:58 PM, Anjib Mulepati wrote: > User info is put into session after they log in so its in > LoginSubmitAction clas

Re: Form handling by direct URL in Struts 1.3.8

2012-06-13 Thread Anjib Mulepati
User info is put into session after they log in so its in LoginSubmitAction class. public class LoginSubmitAction extends org.apache.struts.action.Action { private static final String ERROR = "errorFront"; private static final String SUCCESS = "success"; private static Log log = L

Re: Form handling by direct URL in Struts 1.3.8

2012-06-13 Thread Dave Newton
I don't see anything that puts a user info into session (or request, I forgot where it was), so it makes sense the JSP would fail. [OT] In the future, consider removing useless, empty comments so people trying to help have less work to do :) Dave On Wed, Jun 13, 2012 at 11:43 AM, Anjib Mulepati

Re: Form handling by direct URL in Struts 1.3.8

2012-06-13 Thread Anjib Mulepati
1. Base Class public abstract class BaseAction extends org.apache.struts.action.Action { private static Log log = LogFactory.getLog("BaseAction"); /** * * @param mapping * @param form * @param request * @param response * @return * @throws IOException

Re: Form handling by direct URL in Struts 1.3.8

2012-06-13 Thread Jason Zheng
Anjib, would you like to show us the codes in the Action ChangePasswordAction? On Wed, Jun 13, 2012 at 10:58 PM, Dave Newton wrote: > Then it's likely you're doing something wrong if you're forwarding to a > page before creating the info that page needs. > > Dave > > On Wed, Jun 13, 2012 at 10:5

Re: Form handling by direct URL in Struts 1.3.8

2012-06-13 Thread Dave Newton
Then it's likely you're doing something wrong if you're forwarding to a page before creating the info that page needs. Dave On Wed, Jun 13, 2012 at 10:53 AM, Anjib Mulepati wrote: > Even though I put validation in ActionForm validate() method failure will > take to changePasswordPage. I do have

Re: Form handling by direct URL in Struts 1.3.8

2012-06-13 Thread Anjib Mulepati
Even though I put validation in ActionForm validate() method failure will take to changePasswordPage. I do have validation to check form field. On 6/13/2012 9:17 AM, Dave Newton wrote: Maybe some sort of validation would be helpful. Dave On Wed, Jun 13, 2012 at 9:03 AM, Anjib Mulepati wrote:

Re: Form handling by direct URL in Struts 1.3.8

2012-06-13 Thread Dave Newton
Maybe some sort of validation would be helpful. Dave On Wed, Jun 13, 2012 at 9:03 AM, Anjib Mulepati wrote: > Hi All, > > I have question regarding handling form submission by direct URL in Struts > 1.3.8 > > I have a page to change password which user can access after they login. > URL for tha

Form handling by direct URL in Struts 1.3.8

2012-06-13 Thread Anjib Mulepati
Hi All, I have question regarding handling form submission by direct URL in Struts 1.3.8 I have a page to change password which user can access after they login. URL for that page is http://localhost:8080/MyApp/changepassword.do I have action mapping as follow: scope="request" name="Change