Re: redirect command

2009-11-29 Thread Chris Pratt
if you are returning "success" (or SUCCESS), then you need to define login.jsp (or, since it's the default you could just define login.jsp). What you defined will only work if you return "input" (or INPUT) from your execute or if you action is returning from the input() method. (*Chris*) On Sun,

Re: redirect command

2009-11-29 Thread Nguyen Xuan Son
Dear I've tried login.jsp but nothing happen, it seems that even if i fall into the irrelevant situation it doesnt not redirect to the login.jsp page thank you very much 2009/11/30 Saeed Iqbal > type="redirect" > > On Monday, November 30, 2009, Saeed Iqbal wrote: > > Just have redirect near

Re: redirect command

2009-11-29 Thread Saeed Iqbal
type="redirect" On Monday, November 30, 2009, Saeed Iqbal wrote: > Just have redirect near result name="" > > On Monday, November 30, 2009, Nguyen Xuan Son wrote: >> dear all >> here i've the detail of struts file >> >> sessionChk.jsp >> >> >> and in the SessionCheckAction.java file i have >>

Re: redirect command

2009-11-29 Thread Saeed Iqbal
Just have redirect near result name="" On Monday, November 30, 2009, Nguyen Xuan Son wrote: > dear all > here i've the detail of struts file > > sessionChk.jsp > > > and in the SessionCheckAction.java file i have > public class SessionCheckAction extends ActionSupport{ > public String execute()

redirect command

2009-11-29 Thread Nguyen Xuan Son
dear all here i've the detail of struts file sessionChk.jsp and in the SessionCheckAction.java file i have public class SessionCheckAction extends ActionSupport{ public String execute() throws Exception { Map ses = ActionContext.getContext().getSession(); // check where the the session is null

Re: password encrypted

2009-11-29 Thread Chris Pratt
The PHP appears to be encoded somehow, whereas the Java is a pure number. Looks like you have a bit of research ahead. (*Chris*) On Sun, Nov 29, 2009 at 9:01 PM, Nguyen Xuan Son wrote: > Dear Chris > after I encrypted the password into sha1 code > with the string "123456" i got the > result: >

Re: password encrypted

2009-11-29 Thread Nguyen Xuan Son
Dear Chris after I encrypted the password into sha1 code with the string "123456" i got the result: 124-74-141-9-202-55-98-175-97-229-149-32-148-61-194-100-148-248-148-27 but it looks different from what i've made by using PHP method: ?2S?j?k?-Jo?=????A??J??v!??3?Hm?F?????^???y~???Td

Re: password encrypted

2009-11-29 Thread Chris Pratt
java.security.MessageDigest (*Chris*) On Sun, Nov 29, 2009 at 8:34 PM, Nguyen Xuan Son wrote: > Dear all > i would like to encrypted the password into sha1 code > although I tried to search whether is there any class that I can simply use > as i did in PHP (just simply use the method sha1(stri

Re: password encrypted

2009-11-29 Thread Saeed Iqbal
Are you using Spring Security? Its very simple then. On Mon, Nov 30, 2009 at 9:34 AM, Nguyen Xuan Son wrote: > Dear all > i would like to encrypted the password into sha1 code > although I tried to search whether is there any class that I can simply use > as i did in PHP (just simply use the met

password encrypted

2009-11-29 Thread Nguyen Xuan Son
Dear all i would like to encrypted the password into sha1 code although I tried to search whether is there any class that I can simply use as i did in PHP (just simply use the method sha1(string)) but failed do you have any suggestion? thank you very much -- =

Re: validation xml file

2009-11-29 Thread Nguyen Xuan Son
Dear denis i've attached the struts.xml file with this email the problem is when i dont input any information the system doesnt stop immediatly at LoginAction-validation.xml file but also implement LoginAction.java file thus the system check everything even it is not necessary it might make the sys

Re: unstatable implement

2009-11-29 Thread Chris Pratt
While you're absolutely correct that the preferred method of getting to the session attribute map is by implementing the SessionAware interface, calling ServletActionContext.getContext().getSession() (as Nguyen did) will give you the Map. And you are also correct that if you actually need to get h

Re: unstatable implement

2009-11-29 Thread KamHon Eng
to able to retrieve session object in Action class, there are 2 ways, 1st way is using ServletActionContext.getRequest().getSession() it will giving u a HttpSession object. 2nd way is, your Action class implements org.apache.struts2.interceptor.SessionAware. Please refer to JavaDoc. For your info

Re: unstatable implement

2009-11-29 Thread Denis Cabasson
Obviously, if you don't have a session, ses.get("context") will return null. And null.toString() that's a nice NPE. I usually use StringUtils.isNotEmpty for commons-lang : http://commons.apache.org/lang/api-release/org/apache/commons/lang/StringUtils.html#isNotEmpty(java.lang.String)

Re: unstatable implement

2009-11-29 Thread Saeed Iqbal
Yes the toString of null is whats causing your error On Monday, November 30, 2009, Nguyen Xuan Son wrote: > on line 10 I have > if(!ses.get("context").equals(null)&&!ses.get("role").equals(null)){ > if(!ses.get("context").toString().isEmpty()&&!ses.get("role").toString().isEmpty()){ > > thanks fo

Re: validation xml file

2009-11-29 Thread Denis Cabasson
Everything seems to be looking good. Is your validation xml file in the same package as your action? Are you using the defaultStack interceptor stack? If you leave txtName or txtPass empty, are you still proceeding to C0002_Home.jsp? Something must not be in place, because your example seem

Re: unstatable implement

2009-11-29 Thread Nguyen Xuan Son
on line 10 I have if(!ses.get("context").equals(null)&&!ses.get("role").equals(null)){ if(!ses.get("context").toString().isEmpty()&&!ses.get("role").toString().isEmpty()){ thanks for your considering 2009/11/30 Saeed Iqbal > Whats on line 10 > > On Monday, November 30, 2009, Nguyen Xuan Son >

Re: unstatable implement

2009-11-29 Thread Chris Pratt
Isn't ses.get("context") going to always return null the first time thru? (*Chris*) P.S. You should look at using an Interceptor for this check. This type of situation is exactly what they were invented for. On Sun, Nov 29, 2009 at 5:54 PM, Nguyen Xuan Son wrote: > dear all > I have the C000

Re: [Struts 2.1.8] Message properties on SUBMIT tag not working

2009-11-29 Thread Denis Cabasson
You should use key to change the text outputted on the screen. You should use name as well to avoid the error you are seeing: the name is being used as the property to set on your action. This error is actually a warning, that is not preventing anything from working fine in your application. I

Re: unstatable implement

2009-11-29 Thread Saeed Iqbal
Whats on line 10 On Monday, November 30, 2009, Nguyen Xuan Son wrote: > dear all > I have the C0002_Home.jsp and sessionChk.jsp files. The C0002_Home.jsp's > source code is > > > the meaning of this source code is to check users session whenever they > enter the webpage > the struts.xml is struc

unstatable implement

2009-11-29 Thread Nguyen Xuan Son
dear all I have the C0002_Home.jsp and sessionChk.jsp files. The C0002_Home.jsp's source code is the meaning of this source code is to check users session whenever they enter the webpage the struts.xml is structured as: sessionChk.jsp C0002_Home.jsp the detail of the SessionCheckAction.java

unstatable implement

2009-11-29 Thread Nguyen Xuan Son
dear all I have the C0002_Home.jsp and sessionChk.jsp files. The C0002_Home.jsp's source code is the meaning of this source code is to check users session whenever they enter the webpage the struts.xml is structured as: sessionChk.jsp C0002_Home.jsp the detail of the SessionCheckAction.java

Re: validation xml file

2009-11-29 Thread Nguyen Xuan Son
I think i have it. here is the detail C0002_Home.jsp login.jsp Here is the HTML tag for the submit button Please tell me what should i correct? thank you very much 2009/11/30 Denis Cabasson > Do you have a result named "input" tied to your LoginAction? What is it? > > Denis. > > Nguyen Xuan

Re: excute method

2009-11-29 Thread Brian Thompson
Several people have mentioned Preparable, but TBH I'm not sure why. The OP is really just trying to get a "Hello World" Struts app working ... something for which Preparable is irrelevant. Wes's questions are good - I'd also like to see the Action class declaration, the contents of the log, and t

[Struts 2.1.8] Message properties on SUBMIT tag not working

2009-11-29 Thread Celinio Fernandes
Hi, I have a message properties file in my web application. I use it for many tags such as textfield, text ... For instance : It works well except with the SUBMIT tag :     I get this error, whether i use name or key : 20:33:21,198 INFO  [BeanSelectionProvider] Loading global messages from me

Re: validation xml file

2009-11-29 Thread Denis Cabasson
Do you have a result named "input" tied to your LoginAction? What is it? Denis. Nguyen Xuan Son a écrit : Dear all I have these in the LoginAction-validation.xml file false error false error but it seems that even there is a error it still continue to implement the LoginAction.java

validation xml file

2009-11-29 Thread Nguyen Xuan Son
Dear all I have these in the LoginAction-validation.xml file false error false error but it seems that even there is a error it still continue to implement the LoginAction.java file what should i do if i want it stop implementing the LoginAction.java whenever there is any error appear t

Re: Alert Box issue in Struts

2009-11-29 Thread deepakl_2000
Hi pawel, im not talking about struts validation,im talking abt javascript validation for my requirement. please dont confuse it with struts validation framework. my requirement is different and is no way linked to Struts validation framework Paweł Wielgus wrote: > > Hi Deepak,

Re: Any Struts + mysql example ?

2009-11-29 Thread Saeed Iqbal
Martin: I am not sure of the correct terminology. My being a non native English speaker has cost me jobs already :( On Sun, Nov 29, 2009 at 10:01 AM, Martin Gainty wrote: > > the Spring 2.5 distro has a Hibernate example > org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter > > did you