How can i get servlet in my sessionDestroy() method?
DISCLAIMER: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ---
RE: servlet.getServletContext().getAttribute("userList") is throwing NullPointerException in my sessionDestroyed() method
The listener class is extending Action as well as implementing HttpSessionListener interface. Cant I have servlet in my sessionDestroy() method? -Original Message- From: Jeromy Evans [mailto:[EMAIL PROTECTED] Sent: Monday, June 11, 2007 10:42 AM To: Struts Users Mailing List Subject: Re: servlet.getServletContext().getAttribute("userList") is throwing NullPointerException in my sessionDestroyed() method > I am getting NullPointerException in this line Hashtable userList = (Hashtable) servlet.getServletContext().getAttribute("userList"); As suggested by others the last time you asked this question, first try to determine whether it's the the servlet, servletContext or HashTable that's null. HINT: Where did you get 'servlet' from in the sessionDestroyed() method? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] DISCLAIMER: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
servlet.getServletContext().getAttribute("userList") is throwing NullPointerException in my sessionDestroyed() method
Hi team, In my login action I am adding the user who logged in into hash table and I am putting that hash table in servlet.getServletContext().setAttribute("") as fallows Hashtable userList = new Hashtable(); userList.put("username",username); servlet.getServletContext().setAttribute("userList",userList); and in my sessionDestroy() method I am removing that user from the context when his session expires as fallows HttpSession session = sessionEvent.getSession(); String user = (String) session.getAttribute("username"); System.out.print(" USER "+user); session.removeAttribute("ServiceNo"); Hashtable userList = (Hashtable) servlet.getServletContext().getAttribute("userList"); userList.remove(user); I am getting NullPointerException in this line Hashtable userList = (Hashtable) servlet.getServletContext().getAttribute("userList"); But I am sure the list in not null; Regards, Sreenivasula Reddy A DISCLAIMER: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ---
I am unable to access servlet in my sessionDestroy() method?
DISCLAIMER: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ---
I am Unable To access servlet.getServletContext().getAttribte("") in sessionDestroy() method
Hi Community, In my login action when ever a user logs in I am putting his user id in hash table like this Hashtable findUser = new Hashtable(); userList.put("username",username); servlet.getServletContext().setAttribute("userList",userList); now I want to remove this user when his session expires in sessionDestroyed() method of HttpSessionListener HttpSession session = sessionEvent.getSession(); String user = (String) session.getAttribute("username"); Hashtable userList = (Hashtable) servlet.getServletContext().getAttribute("userList"); userList.remove(user) but I am getting NullPointerException in the following line Hashtable userList = (Hashtable) servlet.getServletContext().getAttribute("userList"); Please help me out Regards, Sreenivasula Reddy A DISCLAIMER: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ---
RE: [OT] Re: How Can I Upgrade My Dev Environment
Guru I asked my hr currently we are having recruitment in embedded systems -Original Message- From: Srinivasula Reddy A , Bangalore [mailto:[EMAIL PROTECTED] Sent: Friday, June 08, 2007 2:15 PM To: Struts Users Mailing List Subject: RE: [OT] Re: How Can I Upgrade My Dev Environment Yaa I am able to deploy -Original Message- From: Raghupathy, Gurumoorthy [mailto:[EMAIL PROTECTED] Sent: Friday, June 08, 2007 1:44 PM To: Struts Users Mailing List Subject: RE: [OT] Re: How Can I Upgrade My Dev Environment You already have the environment to work on servlet 2.4 spec . have you tried to write the code and deploy it to jboss ? if you are not able to to then send us more details -Original Message- From: Antonio Petrelli [mailto:[EMAIL PROTECTED] Sent: 08 June 2007 08:40 To: Struts Users Mailing List Subject: [OT] Re: How Can I Upgrade My Dev Environment 2007/6/8, Srinivasula Reddy A , Bangalore <[EMAIL PROTECTED]>: > Currently we are using struts 1.2, jdk1.4, JBoss 4, eclipse > 3.1 as our development environment. Now we need some listeners for our > application. > How I can upgrade my development environment to support listeners (which > are in servlet specification 2.4) JBoss 4 supports Servlet 2.4 so what's the problem? - 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] DISCLAIMER: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. --- - 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] Re: How Can I Upgrade My Dev Environment
Yaa I am able to deploy -Original Message- From: Raghupathy, Gurumoorthy [mailto:[EMAIL PROTECTED] Sent: Friday, June 08, 2007 1:44 PM To: Struts Users Mailing List Subject: RE: [OT] Re: How Can I Upgrade My Dev Environment You already have the environment to work on servlet 2.4 spec . have you tried to write the code and deploy it to jboss ? if you are not able to to then send us more details -Original Message- From: Antonio Petrelli [mailto:[EMAIL PROTECTED] Sent: 08 June 2007 08:40 To: Struts Users Mailing List Subject: [OT] Re: How Can I Upgrade My Dev Environment 2007/6/8, Srinivasula Reddy A , Bangalore <[EMAIL PROTECTED]>: > Currently we are using struts 1.2, jdk1.4, JBoss 4, eclipse > 3.1 as our development environment. Now we need some listeners for our > application. > How I can upgrade my development environment to support listeners (which > are in servlet specification 2.4) JBoss 4 supports Servlet 2.4 so what's the problem? - 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] DISCLAIMER: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How Can I Upgrade My Dev Environment
Hi Struts Community, Currently we are using struts 1.2, jdk1.4, JBoss 4, eclipse 3.1 as our development environment. Now we need some listeners for our application. How I can upgrade my development environment to support listeners (which are in servlet specification 2.4) Already 10% of our development is over. So based on this suggest me good choice Regards, Sreenivasula Reddy A DISCLAIMER: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ---
RE: [S2] decoding values of objects properties
BUT GURU WHEN I CLOSE THE IE SESSEIONDESTROYED METHOD IS NOT EXECUTING IS THERE ANY CONFIGURATION PARAMETERS I HAVE TO SET IN WEB.XML OR STRUTS-CONFIG.XML -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 06, 2007 4:45 PM To: Struts Users Mailing List Subject: Re: [S2] decoding values of objects properties I'm still not entirely what you're decoding from and to; it sounds like something is fundamentally broken, but... Remember that with OGNL you *can* call arbitrary methods, including static utility methods, from with the EL. So with either a static decoding class or (preferably) a service object in your action if you're iterating over a list you can call methods on items from that list. d. --- Paolo Beccari <[EMAIL PROTECTED]> wrote: > > > --- Dave Newton wrote: > > > > Why? > > > > I'll try to explain. The main problem is, that i > would not to expose a > single getter-method in the action for each property > I want to decode. I'm > searching for a more generic method. > I thought on some possibile solution, one was to > return, in each action, the > entire decode set (roughly speaking, a series of > tuples name-value-decode). > That way, I could handle it with a decode. In addition, if the decoded value I'm > searching is the last in the > list, the list is entirely scrolled before finding > result. So I tend to > discard that. > > Maybe it is only a matter of wrong architectural > design: we are returning to > the views some objects mapped from the database > layer "as they are". It is > possible we need an additional level between, to > provide decoded values for > each property, but the temptation to use a scriplet > <%=Decode(name, value)%> > with a generic, singleton Decoder class is still > strong :). > > > > > I've never had to do that, but if I did, I'd be > most > > likely to do it in the action or, more likely, a > > service object in the action. > > > > d. > > > > Yes, I'd be most likely to do, too. But I have to > find a way to NOT write > hundreds of methods, one for each decode-set. > Well, I'll continue thinking on it, BTW thanks for > reply. > > P. > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > Get the free Yahoo! toolbar and rest assured with the added security of spyware protection. http://new.toolbar.yahoo.com/toolbar/features/norton/index.php - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] DISCLAIMER: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to Protect the user to login in Multiple system (Multiple browser) when the session is active.
This is the snippet I am writing in my login action if(servlet.getServletContext().getAttribute("userList")!=null){ System.out.println(" IN SIDE IF OF CONTEXT "); Hashtable findUser = new Hashtable(); findUser = (Hashtable) servlet.getServletContext().getAttribute("userList"); findUser.contains(username); expDTO = new ExceptionDisplayDTO(DFSConstants.FORWARD_FAILURE,ExpContextConstants.LOG IN_FAILED); expDisplayDetails.set(expDTO); throw new LoginFailedException("LoginFailedException"); }else{ System.out.println(" IN SIDE ELSE OF CONTEXT "); Hashtable userList = new Hashtable(); userList.put("username",username); servlet.getServletContext().setAttribute("userList",userList); } But the thing is if the user close the IE instead of log out I am unable to remove the user from the hash table How can I overcome this? Regards, Sreenivasula Reddy A -Original Message- From: Srinivasula Reddy A , Bangalore [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 06, 2007 1:48 PM To: Struts Users Mailing List Subject: RE: How to Protect the user to login in Multiple system (Multiple browser) when the session is active. Hi guru volume of hits is less and my server is running on single machine only so give me some sample snippet for this kind of development -Original Message- From: Raghupathy, Gurumoorthy [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 06, 2007 1:19 PM To: Struts Users Mailing List Subject: RE: How to Protect the user to login in Multiple system (Multiple browser) when the session is active. My answer is "It depends". If the volume (number of hits) of your website is low and your server is on a single node then you can create a hashtable of users (user name as key) as an CONTEXT attribute and each time someone logs in you can check the user against the key in the hashtable ... if the keay already exists tell them to Get lost and once the user is logged off you can remove them from the hash.. If your application is running as part of a farm then store the status in DB / persistence medium. However there will be a performance hit Have a look at http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletConte xt.html One pattern which can be of helps is "observer pattern" which will observe user logging in and logging out when used as a filter http://java.sun.com/products/servlet/Filters.html some of the questions you have been asking on the forum has nothing to do with struts ... it is all about servlet specification Read them at http://jcp.org/aboutJava/communityprocess/final/jsr154/index.html My suggestion will again be RTFM Regards Guru -Original Message- From: Srinivasula Reddy A , Bangalore [mailto:[EMAIL PROTECTED] Sent: 06 June 2007 07:51 To: Struts Users Mailing List Subject: How to Protect the user to login in Multiple system (Multiple browser) when the session is active. Hi Team, How to protect the user to login in multiple browsers when the session is action. For example in gmail if we login in one browser and we are surfing, then if we open another IE and type gmail it will redirect to the page where we are surfing in the previous IE. I need this kind of feature for my login system. How to implement this in struts Give me some sample snippet or rough idea Regards, Sreenivasula Reddy A DISCLAIMER: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. --- -
RE: How to Protect the user to login in Multiple system (Multiple browser) when the session is active.
Hi guru volume of hits is less and my server is running on single machine only so give me some sample snippet for this kind of development -Original Message- From: Raghupathy, Gurumoorthy [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 06, 2007 1:19 PM To: Struts Users Mailing List Subject: RE: How to Protect the user to login in Multiple system (Multiple browser) when the session is active. My answer is "It depends". If the volume (number of hits) of your website is low and your server is on a single node then you can create a hashtable of users (user name as key) as an CONTEXT attribute and each time someone logs in you can check the user against the key in the hashtable ... if the keay already exists tell them to Get lost and once the user is logged off you can remove them from the hash.. If your application is running as part of a farm then store the status in DB / persistence medium. However there will be a performance hit Have a look at http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletConte xt.html One pattern which can be of helps is "observer pattern" which will observe user logging in and logging out when used as a filter http://java.sun.com/products/servlet/Filters.html some of the questions you have been asking on the forum has nothing to do with struts ... it is all about servlet specification Read them at http://jcp.org/aboutJava/communityprocess/final/jsr154/index.html My suggestion will again be RTFM Regards Guru -Original Message----- From: Srinivasula Reddy A , Bangalore [mailto:[EMAIL PROTECTED] Sent: 06 June 2007 07:51 To: Struts Users Mailing List Subject: How to Protect the user to login in Multiple system (Multiple browser) when the session is active. Hi Team, How to protect the user to login in multiple browsers when the session is action. For example in gmail if we login in one browser and we are surfing, then if we open another IE and type gmail it will redirect to the page where we are surfing in the previous IE. I need this kind of feature for my login system. How to implement this in struts Give me some sample snippet or rough idea Regards, Sreenivasula Reddy A DISCLAIMER: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. --- - 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: How to Protect the user to login in Multiple system (Multiple browser) when the session is active.
Hi guru I don't know the meaning of RTFM? What is meant by RTFM? -Original Message- From: Raghupathy, Gurumoorthy [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 06, 2007 1:19 PM To: Struts Users Mailing List Subject: RE: How to Protect the user to login in Multiple system (Multiple browser) when the session is active. My answer is "It depends". If the volume (number of hits) of your website is low and your server is on a single node then you can create a hashtable of users (user name as key) as an CONTEXT attribute and each time someone logs in you can check the user against the key in the hashtable ... if the keay already exists tell them to Get lost and once the user is logged off you can remove them from the hash.. If your application is running as part of a farm then store the status in DB / persistence medium. However there will be a performance hit Have a look at http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletConte xt.html One pattern which can be of helps is "observer pattern" which will observe user logging in and logging out when used as a filter http://java.sun.com/products/servlet/Filters.html some of the questions you have been asking on the forum has nothing to do with struts ... it is all about servlet specification Read them at http://jcp.org/aboutJava/communityprocess/final/jsr154/index.html My suggestion will again be RTFM Regards Guru -Original Message- From: Srinivasula Reddy A , Bangalore [mailto:[EMAIL PROTECTED] Sent: 06 June 2007 07:51 To: Struts Users Mailing List Subject: How to Protect the user to login in Multiple system (Multiple browser) when the session is active. Hi Team, How to protect the user to login in multiple browsers when the session is action. For example in gmail if we login in one browser and we are surfing, then if we open another IE and type gmail it will redirect to the page where we are surfing in the previous IE. I need this kind of feature for my login system. How to implement this in struts Give me some sample snippet or rough idea Regards, Sreenivasula Reddy A DISCLAIMER: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. --- - 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]
How to Protect the user to login in Multiple system (Multiple browser) when the session is active.
Hi Team, How to protect the user to login in multiple browsers when the session is action. For example in gmail if we login in one browser and we are surfing, then if we open another IE and type gmail it will redirect to the page where we are surfing in the previous IE. I need this kind of feature for my login system. How to implement this in struts Give me some sample snippet or rough idea Regards, Sreenivasula Reddy A DISCLAIMER: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ---
How to Protect copying the URL in another explorer to access the data in Struts
Hi Team, How can protect copying or book marking URLs in my Struts application. Give me some sample snippet or rough idea. Regards, Sreenivasula Reddy A DISCLAIMER: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ---
RE: How To Lock User Account If he Failed to give Correct Password in three attempts
Thanks guru I will come back to you after trying this snippet -Original Message- From: Raghupathy, Gurumoorthy [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 05, 2007 4:29 PM To: Struts Users Mailing List Subject: RE: How To Lock User Account If he Failed to give Correct Password in three attempts HttpSession session = request.getSession(); If ( session.getAttribute("LoginCount") == null ) { Session.setAttribute("LoginCount", new Integer(1)); } else { Integer loginCount = session.getAttribute("LoginCount"); try { Writecode to login; } catch (Loginexception e) { If (loginCount.intValue() >2 ) { Write code to block the user return mapping.findForware("AccountLocked"); } else { loginCount = new Integer(loginCount.intValue() +1 ); return mapping.findForware("Login"); } } } Regards Guru -----Original Message- From: Srinivasula Reddy A , Bangalore [mailto:[EMAIL PROTECTED] Sent: 05 June 2007 11:45 To: Struts Users Mailing List Subject: RE: How To Lock User Account If he Failed to give Correct Password in three attempts Yaa I know but I need some sample exact steps -Original Message- From: Raghupathy, Gurumoorthy [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 05, 2007 4:13 PM To: Struts Users Mailing List Subject: RE: How To Lock User Account If he Failed to give Correct Password in three attempts Store the count in the session using appropriate name Once that is above the limit then write the code to lock it ... . One suggestion though . All business logic code in single action That is not a good design ... Cant you make your business objects more layered ? Regards Guru -----Original Message- From: Srinivasula Reddy A , Bangalore [mailto:[EMAIL PROTECTED] Sent: 05 June 2007 10:17 To: Struts Users Mailing List Subject: How To Lock User Account If he Failed to give Correct Password in three attempts Hi Struts User Community, Here I am sending my login action code (part only) and My DAO Code. Now I have to lock the user if he failed to enter correct user name and password in three attempts. How can I implement this in struts? Please help me with some sample code or rough idea? String username = ((LoginForm) form).getUsername(); String password = ((LoginForm) form).getPassword(); String newPassword = com.dfs.common.helper.PasswordService.getInstance().encrypt(password); AccessControlDAO accessDAO = new AccessControlDAO(); UserTo userDTO = accessDAO.getUser(username, newPassword); if(userDTO==null){ throw new LoginFailedException("LoginFailedException"); } public UserTo getUser(String username, String password)throws BaseAppException{ DBConnection ora = DBConnection.getInstance(); Connection conn = ora.createConnection(); PreparedStatement stmt = null; ResultSet rs = null; UserTo userDTO = null; Query = "select * from SYSTEM_USER where SERVICE_NO=? and PASSWORD=?"; if (conn != null) { try{ stmt = conn.prepareStatement(Query); stmt.setString(1, username); stmt.setString(2, password); rs = stmt.executeQuery(); while(rs.next()){ userDTO = new UserTo(); userDTO.setServiceNo(rs.getString("SERVICE_NO")); userDTO.setEmpName(rs.getString("EMP_NAME")); } } catch (SQLException sqle) { throw new BaseDBException("BaseDBException"); } finally { try{ ora.closeConnection(conn); stmt.close();
RE: How To Lock User Account If he Failed to give Correct Password in three attempts
Yaa I know but I need some sample exact steps -Original Message- From: Raghupathy, Gurumoorthy [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 05, 2007 4:13 PM To: Struts Users Mailing List Subject: RE: How To Lock User Account If he Failed to give Correct Password in three attempts Store the count in the session using appropriate name Once that is above the limit then write the code to lock it ... . One suggestion though . All business logic code in single action That is not a good design ... Cant you make your business objects more layered ? Regards Guru -Original Message- From: Srinivasula Reddy A , Bangalore [mailto:[EMAIL PROTECTED] Sent: 05 June 2007 10:17 To: Struts Users Mailing List Subject: How To Lock User Account If he Failed to give Correct Password in three attempts Hi Struts User Community, Here I am sending my login action code (part only) and My DAO Code. Now I have to lock the user if he failed to enter correct user name and password in three attempts. How can I implement this in struts? Please help me with some sample code or rough idea? String username = ((LoginForm) form).getUsername(); String password = ((LoginForm) form).getPassword(); String newPassword = com.dfs.common.helper.PasswordService.getInstance().encrypt(password); AccessControlDAO accessDAO = new AccessControlDAO(); UserTo userDTO = accessDAO.getUser(username, newPassword); if(userDTO==null){ throw new LoginFailedException("LoginFailedException"); } public UserTo getUser(String username, String password)throws BaseAppException{ DBConnection ora = DBConnection.getInstance(); Connection conn = ora.createConnection(); PreparedStatement stmt = null; ResultSet rs = null; UserTo userDTO = null; Query = "select * from SYSTEM_USER where SERVICE_NO=? and PASSWORD=?"; if (conn != null) { try{ stmt = conn.prepareStatement(Query); stmt.setString(1, username); stmt.setString(2, password); rs = stmt.executeQuery(); while(rs.next()){ userDTO = new UserTo(); userDTO.setServiceNo(rs.getString("SERVICE_NO")); userDTO.setEmpName(rs.getString("EMP_NAME")); } } catch (SQLException sqle) { throw new BaseDBException("BaseDBException"); } finally { try{ ora.closeConnection(conn); stmt.close(); rs.close(); }catch(SQLException e){ throw new BaseDBException("BaseDBException"); } } }else{ throw new BaseDBException("BaseDBException"); } return userDTO; } Regards, Sreenivasula Reddy A. DISCLAIMER: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message with
How To Lock User Account If he Failed to give Correct Password in three attempts
Hi Struts User Community, Here I am sending my login action code (part only) and My DAO Code. Now I have to lock the user if he failed to enter correct user name and password in three attempts. How can I implement this in struts? Please help me with some sample code or rough idea? String username = ((LoginForm) form).getUsername(); String password = ((LoginForm) form).getPassword(); String newPassword = com.dfs.common.helper.PasswordService.getInstance().encrypt(password); AccessControlDAO accessDAO = new AccessControlDAO(); UserTo userDTO = accessDAO.getUser(username, newPassword); if(userDTO==null){ throw new LoginFailedException("LoginFailedException"); } public UserTo getUser(String username, String password)throws BaseAppException{ DBConnection ora = DBConnection.getInstance(); Connection conn = ora.createConnection(); PreparedStatement stmt = null; ResultSet rs = null; UserTo userDTO = null; Query = "select * from SYSTEM_USER where SERVICE_NO=? and PASSWORD=?"; if (conn != null) { try{ stmt = conn.prepareStatement(Query); stmt.setString(1, username); stmt.setString(2, password); rs = stmt.executeQuery(); while(rs.next()){ userDTO = new UserTo(); userDTO.setServiceNo(rs.getString("SERVICE_NO")); userDTO.setEmpName(rs.getString("EMP_NAME")); } } catch (SQLException sqle) { throw new BaseDBException("BaseDBException"); } finally { try{ ora.closeConnection(conn); stmt.close(); rs.close(); }catch(SQLException e){ throw new BaseDBException("BaseDBException"); } } }else{ throw new BaseDBException("BaseDBException"); } return userDTO; } Regards, Sreenivasula Reddy A. DISCLAIMER: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ---
Upload Utility in Struts
Hi Struts User Community, I need rough Idea of how to implement upload file feature in struts as a component. Atleast give me some rough idea or send some urls which provides that help. Regards, Sreenivasula Reddy A DISCLAIMER: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ---
Need Help On Combo Box Population VERY URGENT REQUIREMENT
Hi Struts User Community, I need a rough IDEA / CODE on there are three combo boxes are there depending on the first combo box selection second combo box has to populate and depending on the second combo box selection third one has to populate. Like populating all the states of country in a combo box when I select a county in another combo box. Again if I select state in the combo box I have to populate all the districts in another combo box What are the tags I have to use in my JSP and what is the code I have to write in my ACTION class. Regards, Sreenivasula Reddy A DISCLAIMER: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ---
RE: Need Help On Pop Up
yes -Original Message- From: Kapil Sharma [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 08, 2007 3:25 PM To: Struts Users Mailing List Subject: RE: Need Help On Pop Up It is working at my end. Have u specified correctly the form names and field values. n Have u used the function to open that popup properly. Thanks and Regards, Kapil Sharma -Original Message- From: Srinivasula Reddy A , Bangalore [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 08, 2007 6:46 PM To: Struts Users Mailing List Subject: RE: Need Help On Pop Up Hi sharma, function updateParent(){ opener.document.form1.name.value = document.childForm.others.value; self.close(); return false; } In the above code the value is not reflecting in the parent jsp -Original Message- From: Kapil Sharma [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 08, 2007 3:07 PM To: Struts Users Mailing List Subject: RE: Need Help On Pop Up //calling the child (popup ) window function fnOpenPopup (path, values) { CHECK_CHANGE = 1; if (childWin && !childWin.closed) { childWin.close(); } var params="toolbar=0,"; //toolbar off params+="location=0,"; //location/address box off params+="directories=0,"; //directories off params+="status=0,"; //status bar off params+="menubar=0,"; //menu baroff params+="scrollbars=1,"; //scrollbar on(comes only if size of window is too small for text) params+="resizable=0,"; //cannot be resized params+="left= "+200+","; //position of window from left in pixels params+="top= "+200+","; //position of window from top in pixels params+="width=100,"; //width of window in pixels params+="height=400"; //height of window in pixels if (values != null) { childWin = window.open(path + "?hdnModePopup=Y"+"&"+values, "popup", params); } else { childWin = window.open(path + "?hdnModePopup=Y", "popup", params); } if (childWin.opener == null) childWin.opener = self; childWin.resizeTo(750,350); childWin.moveTo(30,80); childWin.focus(); } called on submit of popup child window function updateParent(){ opener.document.form1.name.value = document.childForm.others.value; self.close(); return false; } All the values will move to the name field of the parent Thanks and Regards, Kapil Sharma -Original Message- From: Srinivasula Reddy A , Bangalore [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 08, 2007 6:27 PM To: Struts Users Mailing List Subject: RE: Need Help On Pop Up No friend I need how to update the parent jsp with the selected value of pop up jsp -Original Message- From: Antonio Petrelli [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 08, 2007 2:50 PM To: Struts Users Mailing List Subject: Re: Need Help On Pop Up 2007/5/8, Srinivasula Reddy A , Bangalore <[EMAIL PROTECTED]>: > > Hi Struts User Community, > ... > In struts how I can do this please give me sample rough code of JSP, > ACTION CLASS, ACTION MAPPING ELEMENT, and POP UP JSP CODE. It seems like homework! You're asking too much, friend. Try to search the internet, write some code and, then, ask a specific question. Antonio DISCLAIMER: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. --- - 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: Need Help On Pop Up
Hi sharma, function updateParent(){ opener.document.form1.name.value = document.childForm.others.value; self.close(); return false; } In the above code the value is not reflecting in the parent jsp -Original Message- From: Kapil Sharma [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 08, 2007 3:07 PM To: Struts Users Mailing List Subject: RE: Need Help On Pop Up //calling the child (popup ) window function fnOpenPopup (path, values) { CHECK_CHANGE = 1; if (childWin && !childWin.closed) { childWin.close(); } var params="toolbar=0,"; //toolbar off params+="location=0,"; //location/address box off params+="directories=0,"; //directories off params+="status=0,"; //status bar off params+="menubar=0,"; //menu baroff params+="scrollbars=1,"; //scrollbar on(comes only if size of window is too small for text) params+="resizable=0,"; //cannot be resized params+="left= "+200+","; //position of window from left in pixels params+="top= "+200+","; //position of window from top in pixels params+="width=100,"; //width of window in pixels params+="height=400"; //height of window in pixels if (values != null) { childWin = window.open(path + "?hdnModePopup=Y"+"&"+values, "popup", params); } else { childWin = window.open(path + "?hdnModePopup=Y", "popup", params); } if (childWin.opener == null) childWin.opener = self; childWin.resizeTo(750,350); childWin.moveTo(30,80); childWin.focus(); } called on submit of popup child window function updateParent(){ opener.document.form1.name.value = document.childForm.others.value; self.close(); return false; } All the values will move to the name field of the parent Thanks and Regards, Kapil Sharma -Original Message- From: Srinivasula Reddy A , Bangalore [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 08, 2007 6:27 PM To: Struts Users Mailing List Subject: RE: Need Help On Pop Up No friend I need how to update the parent jsp with the selected value of pop up jsp -Original Message- From: Antonio Petrelli [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 08, 2007 2:50 PM To: Struts Users Mailing List Subject: Re: Need Help On Pop Up 2007/5/8, Srinivasula Reddy A , Bangalore <[EMAIL PROTECTED]>: > > Hi Struts User Community, > ... > In struts how I can do this please give me sample rough code of JSP, > ACTION CLASS, ACTION MAPPING ELEMENT, and POP UP JSP CODE. It seems like homework! You're asking too much, friend. Try to search the internet, write some code and, then, ask a specific question. Antonio DISCLAIMER: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. --- - 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: Need Help On Pop Up
No friend I need how to update the parent jsp with the selected value of pop up jsp -Original Message- From: Antonio Petrelli [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 08, 2007 2:50 PM To: Struts Users Mailing List Subject: Re: Need Help On Pop Up 2007/5/8, Srinivasula Reddy A , Bangalore <[EMAIL PROTECTED]>: > > Hi Struts User Community, > ... > In struts how I can do this please give me sample rough code of JSP, > ACTION CLASS, ACTION MAPPING ELEMENT, and POP UP JSP CODE. It seems like homework! You're asking too much, friend. Try to search the internet, write some code and, then, ask a specific question. Antonio DISCLAIMER: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Need Help On Pop Up
Hi Struts User Community, I have a JSP in which I am opening a pop up. In the pop up jsp (struts) I have one input text and search button. When I give some string and click on the submit button it will display the list of names with matching pattern string or exact string from the database. I will select one name with a radio button and clicks on the submit button. That selected value should reflect in my parent jsp and the pop up jsp has to close. In struts how I can do this please give me sample rough code of JSP, ACTION CLASS, ACTION MAPPING ELEMENT, and POP UP JSP CODE. Regards, Sreenivasula Reddy A DISCLAIMER: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]