HTML Encoding in Struts2
Hi experts, I have following code... JAVA: ArrayList obj = new ArrayList(); obj.add(" www.google.com Visit google "); obj.add(" www.yahoo.com Visit yahoo ") JSP: On jsp page source, I am getting "<a href="www.google.com">Visit google</a>" and "<a href="www.yahoo.com">Visit yahoo</a>" So it is not linking "Visit google" and "Visit yahoo", instead of it is showing the whole string " www.google.com Visit google " and www.yahoo.com Visit yahoo . How can I make both linkable..? Thanks in advance Sawan -- View this message in context: http://www.nabble.com/HTML-Encoding-in-Struts2-tf4198863.html#a11942087 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HTML Encoding in Struts2
THANKS...Its working now...:jumping: -- View this message in context: http://www.nabble.com/HTML-Encoding-in-Struts2-tf4198863.html#a11942434 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Handling Session Objects
Hello experts, I have following code... JAVA class: public class Support extends ActionSupport implements SessionAware { protected Map session; public Map getSession() { return session; } @SuppressWarnings({"unchecked"}) public void setSession(Map session) { this.session = session; } } Action class: public class Child extends Support { ArrayList alt = new ArrayList(); alt.add("Test"); public String execute() throws Exception { if ((ArrayList)session.get("obj")==null) { session.put("obj",alt); } } } I have run this code first time and set the "alt" for this session only. Now I copied the link from the browser window and paste it in other machines browser. But unfortunately I also got the SAME "alt" on other machine's browser. I was assuming that for each new browser it will generate a new session and will set new alt for each session. Can any expert help me for this issue... Thanks in advance Sawan -- View this message in context: http://www.nabble.com/Handling-Session-Objects-tf4211020.html#a11978671 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Handling Session Objects
Thanks buddy for your reply, Very firstly I am sorry for provide the confusing code here. I am not putting the same data into each session and I am sure that I am getting the same instance of that data , not just separate copies of the same data. Actually I have a Login.jsp page and on click SUBMIT button the java class will be called. In the java class I am fetching the user name and password from the Login.jsp page and putting them into the session. Now if anyone copy and paste the url on another machine's browser, then How can he/she will get the user name and password there..? But it is happening in my case. I think now I am able to explain in detail...:-) Thanks & regards Sawan Laurie Harper wrote: > > Firstly, you're unconditionally putting the same data into each session, > so are you sure you're getting the same *instance* of that data, not > just separate copies of the same data? > > Actions should be instantiated for each request, so if your code is as > simple as you've presented and you really are getting the same instance > in different sessions, there must be something wrong with your > configuration somewhere. > > L. > > Sawan wrote: >> Hello experts, >> >> I have following code... >> >> JAVA class: >> public class Support extends ActionSupport implements SessionAware >> { >> protected Map session; >> public Map getSession() { return session; } >> @SuppressWarnings({"unchecked"}) public void setSession(Map session) >> { >> this.session = session; } >> } >> >> Action class: >> public class Child extends Support >> { >> ArrayList alt = new ArrayList(); >> alt.add("Test"); >> public String execute() throws Exception >> { >> if ((ArrayList)session.get("obj")==null) >> { >> session.put("obj",alt); >> } >> } >> } >> >> I have run this code first time and set the "alt" for this session only. >> Now >> I copied the link from the browser window and paste it in other machines >> browser. But unfortunately I also got the SAME "alt" on other machine's >> browser. >> >> I was assuming that for each new browser it will generate a new session >> and >> will set new alt for each session. >> >> Can any expert help me for this issue... >> >> Thanks in advance >> >> Sawan > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Handling-Session-Objects-tf4211020.html#a12011091 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Handling Session Objects
Hi Dale, Yes, my url includes ";jsessionid=...", but I am not adding it in my program manually and don't know from where it is coming..? If the problem is due to addition of ";jsessionid=..." then I really wants to remove it from my url. Please suggest me any solution to remove ";jsessionid=..." from my url. Thanks & regards Sawan DNewfield wrote: > > Sawan wrote: >> Now if anyone copy and paste the url on another machine's browser, >> then How can he/she will get the user name and password there..? > > If that url includes ";jsessionid=..." then sure, they've just had their > session hijacked, including all the information you put in that session. > > -Dale > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Handling-Session-Objects-tf4211020.html#a12028386 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Handling Session Objects
Hi Laurie, Yes, my url includes session id, as suggested by Dale. But I am not adding it manually and also don't know from where it is coming. If the problem is only due to addition of session id with the url, then please suggest me to remove it from the URL. Thanks & Regards Sawan Laurie Harper wrote: > > Well, I can think of at least two possibilities: > > 1) the URL you're copying includes a session ID, as suggested by Dale > > 2) the URL you're copying includes request parameters for user name and > password > > What is the exact URL you're copying? What do the relevant action > mappings, JSPs and Java classes look like? You're doing something wrong, > but we'll need to see everything to see where the problem is. > > L. > > Sawan wrote: >> Thanks buddy for your reply, >> >> Very firstly I am sorry for provide the confusing code here. I am not >> putting the same data into each session and I am sure that I am getting >> the >> same instance of that data , not >> just separate copies of the same data. >> >> Actually I have a Login.jsp page and on click SUBMIT button the java >> class >> will be called. In the java class I am fetching the user name and >> password >> from the Login.jsp page and putting them into the session. Now if anyone >> copy and paste the url on another machine's browser, then How can he/she >> will get the user name and password there..? But it is happening in my >> case. >> >> I think now I am able to explain in detail...:-) >> >> Thanks & regards >> >> Sawan >> >> >> >> >> >> Laurie Harper wrote: >>> Firstly, you're unconditionally putting the same data into each session, >>> so are you sure you're getting the same *instance* of that data, not >>> just separate copies of the same data? >>> >>> Actions should be instantiated for each request, so if your code is as >>> simple as you've presented and you really are getting the same instance >>> in different sessions, there must be something wrong with your >>> configuration somewhere. >>> >>> L. >>> >>> Sawan wrote: >>>> Hello experts, >>>> >>>> I have following code... >>>> >>>> JAVA class: >>>> public class Support extends ActionSupport implements SessionAware >>>> { >>>> protected Map session; >>>> public Map getSession() { return session; } >>>> @SuppressWarnings({"unchecked"}) public void setSession(Map >>>> session) >>>> { >>>> this.session = session; } >>>> } >>>> >>>> Action class: >>>> public class Child extends Support >>>> { >>>> ArrayList alt = new ArrayList(); >>>> alt.add("Test"); >>>> public String execute() throws Exception >>>> { >>>> if ((ArrayList)session.get("obj")==null) >>>> { >>>> session.put("obj",alt); >>>> } >>>> } >>>> } >>>> >>>> I have run this code first time and set the "alt" for this session >>>> only. >>>> Now >>>> I copied the link from the browser window and paste it in other >>>> machines >>>> browser. But unfortunately I also got the SAME "alt" on other machine's >>>> browser. >>>> >>>> I was assuming that for each new browser it will generate a new session >>>> and >>>> will set new alt for each session. >>>> >>>> Can any expert help me for this issue... >>>> >>>> Thanks in advance >>>> >>>> Sawan >>> >>> - >>> 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] > > > -- View this message in context: http://www.nabble.com/Handling-Session-Objects-tf4211020.html#a12028434 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Handling Session Objects
>Don't type it in / paste it when you test on the other >machine. Can you please explain me in detail. That what is "\", What I don't type in "\", etc. Thanks and regards Sawan newton.dave wrote: > > --- Sawan <[EMAIL PROTECTED]> wrote: >> If the problem is due to addition of jsessionid then >> I really wants to remove it from my url. > > Don't type it in / paste it when you test on the other > machine. > > d. > > > > > > Be a better Globetrotter. Get better travel answers from someone who > knows. Yahoo! Answers - Check it out. > http://answers.yahoo.com/dir/?link=list&sid=396545469 > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Handling-Session-Objects-tf4211020.html#a12033548 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Handling Session Objects
Thanks a lot Dave for the detail explanation. I have checked the META-INF/context.xml of my web application for cookies and found that it does not have cookies attribute. It means I have cookie enabled session. http://jf.omnis.ch/log/archives/2004/12/disabling-session-cookie-in-tomcat.html But still I am seeing ";jsessionid=XXX" in the url. Please suggest me for any possibility for this. Thanks & Regards Sawan newton.dave wrote: > > --- Sawan <[EMAIL PROTECTED]> wrote: >>> Don't type it in / paste it when you test on the >>> other machine. >> Can you please explain me in detail. That what is >> "\", What I don't type in "\", etc. > > ... > > "\", which I assume is a misspelling of "/" (the > character I used) is used to separate two words, in my > case "in" and "paste". > > I'll do my best to explain it in detail. > > When you test on the other machine do not include the > ";jsessionid=XXX" in the URL. > > Note that the "XXX" in the previous sentence should > not be taken literally; it is a placeholder for > whatever the session id is. > > jsessionid is used by the servlet container for > servlet tracking; it's normally found under > circumstances when you do not have cookies enabled or > on the first request to the application when it (the > application) still doesn't know if you have cookies > enabled. > > d. > > > > > > Shape Yahoo! in your own image. Join our Network Research Panel today! > http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Handling-Session-Objects-tf4211020.html#a12047967 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Action within Action result
Hello Experts, I want to call an Action within the Action result and I am trying following Struts XML. /Action2.action But its not working. How can I fulfill this requirement..? I am really looking forward to get any solution as soon as possible... Thanks Sawan -- View this message in context: http://www.nabble.com/Action-within-Action-result-tf4303336.html#a12249191 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
how to use confirmdialog box
hello, i want to use confirm dialog box in my application, but i faces some problem. so please let me know how i can do my work " onclick="confirm('sure to delete')" >Delete i have done this , it will show confimdialog box and if i click on ok or cancel then deletebucket action is called. but my need is that if i click on OK then it have to call deletebucketaction & when i click on cancel then it have to call browsebucketaction. -- View this message in context: http://www.nabble.com/how-to-use-confirmdialog-box-tf4303528.html#a12249749 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
how to use confirmdialog box
hello, i want to use confirm dialog box in my application, but i faces some problem. so please let me know how i can do my work " " onclick="confirm('sure to delete')" >Delete " i have done this , it will show confimdialog box and if i click on ok or cancel then deletebucket action is called. but my need is that if i click on OK then it have to call deletebucketaction & when i click on cancel then it have to call browsebucketaction. -- View this message in context: http://www.nabble.com/how-to-use-confirmdialog-box-tf4303548.html#a12249806 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
web application with confirmation dialog box
Hello, I want to implement Delete functionality in my Struts web application with confirmation dialog box and did not find any solution for this yet. Please suggest me for any solution. Thanks sawan -- View this message in context: http://www.nabble.com/web-application-with-confirmation-dialog-box-tf4303597.html#a12249932 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RE Action within Action result
Thanks mleneveut, Its working for simple action calling, But I have a request variable in my URL and if I simply redirect to the specified action then I lost the variable. E.G.. I have following URL http://localhost:8080/Action1.action?Argument=Sawan Now if simply call the action then I got... http://localhost:8080/Action2.action I want to preserve "?Argument=Sawan" too and wants the URL like... http://localhost:8080/Action2.action?Argument=Sawan Thanks Sawan mleneveut wrote: > > Add the result type : > > action2 > > > ... > > > (redirect-action if you are in version before 2.0.9) > > > > > > Sawan <[EMAIL PROTECTED]> > 21/08/2007 08:50 > Veuillez répondre à > "Struts Users Mailing List" > > > A > user@struts.apache.org > cc > > Objet > Action within Action result > > > > > > > > Hello Experts, > > I want to call an Action within the Action result and I am trying > following > Struts XML. > > > /Action2.action > > > But its not working. > > How can I fulfill this requirement..? > > I am really looking forward to get any solution as soon as possible... > > Thanks > > Sawan > -- > View this message in context: > http://www.nabble.com/Action-within-Action-result-tf4303336.html#a12249191 > Sent from the Struts - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > -- View this message in context: http://www.nabble.com/Action-within-Action-result-tf4303336.html#a12253535 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]