[S2] fieldError - highlight input field using simple theme?
I have a form with multiple input fields, and I am using the simple theme. Is it possible to determine (maybe using s:if..) when a given field fails validation? I already tried hasFieldErrors(); however, hasFieldErrors() does not allow me to distinguish which field on the form fails. Here is what I want: s:form method=POST action=login_doLogin validate=true cssClass=homeLoginForm fieldset s:actionerror / label for=loginId s:text name=label.loginId / /label s:if test=field loginId is okay -- what do I put here??? s:textfield required=true id=loginId name=loginId size=25 maxlength=100 / /s:if s:else s:textfield required=true id=loginId name=loginId size=25 maxlength=100 cssClass=error / /s:else s:fielderror name=loginId s:paramloginId/s:param /s:fielderror label for=password s:text name=label.password / /label s:if test=field password is okay -- what do I put here??? s:password required=true id=password name=password size=25 maxlength=10 showPassword=true / /s:if s:else s:password required=true id=password name=password size=25 maxlength=10 showPassword=true cssClass=error / /s:else s:fielderror s:parampassword/s:param /s:fielderror s:submit key=button.signIn type=submit / /fieldset /s:form -- View this message in context: http://www.nabble.com/-S2--fieldError---highlight-input-field-using-%22simple%22-theme--tp15060201p15060201.html 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: File Upload
I always try first in Firefox, you know... And yes, I´m debugging with firebug (what would I do without this tool??). If I begin my Plugins.jspx with jsp:root tag (with no syntax problem, as it works fine when is loaded by ShowPlugins.do action) the load function from the javascript gives me an parse error (I don´t know why) and then, begining it with div and importing all namespaces it also works fine when is loaded by ShowPlugins.do action, but does not work when is loaded as response from a file upload request, because the anchor tags are bad generated (not to use ajax theme) (I don´t know if I have explained the issue fine). Thanks. Jeromy Evans escribió: Sorry Pablo, I'm not sure about this. My suggestions are: - try it in FireFox. If it works, you know you have an IE-specific problem. If it doesn't work, there's something wrong with the code - innerHTML is known to have quirks in IE. I'd simplify the HTML result and work upwards from plain text to find the specific combination of HTML tags that cause the problem (not JSP-tags, the generated HTML) I'm not likely to find anything looking at the JSP. You'll have to debug it at runtime. I always use FireBug to inspect the AJAX result prior to inserting it into the page. Pablo Vázquez Blázquez wrote: Any idea? How can I fix the Delete links problem? Pablo Vázquez Blázquez escribió: Well, if I begin my Plugins.jspx with a div tag, it works (before, the begin was a jsp:root tag). But, when the response is loaded (it is the same page but with a new plugin entry), the delete link is bad created. So, 2 questions: a) why didn´t it work with jsp:root? b) why delete links are bad generated if, when I access normally to the page, they are fine? (Now, they dont work with ajax. I click and go to the whole url). c) Why if I don´t comment the cancel button it doesn´t work? Thanks to everybody who has helped me. I can´t send you my Plugins.jspx because my message is recognized as spam... I would be pleased sending it to you by personal email if you wish. - 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: combobox - howto eliminate the optional text-field?
hi, you have to use s:select label=Group ... see example in struts2-showcase-2.0.11 application. - Original Message - From: Dave Newton [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Wednesday, January 23, 2008 6:21 PM Subject: Re: combobox - howto eliminate the optional text-field? Isn't that a select? http://struts.apache.org/2.x/docs/select.html --- xianwinwin [EMAIL PROTECTED] wrote: hi all, I have the following code: s:combobox label=Group name=groupAssociation theme=simple list=#{'red':'red','green':'green','blue':'blue'} headerKey=-8 readonly=true headerValue=--- Please Select --- emptyOption=false value=green / this provides the end user a comboBox with a textfield (user can input his own input not from the list) Q: How can I have a simple combobox WITHOUT the textfield and by that force the end-user to choose only from the list. thanks! -- View this message in context: http://www.nabble.com/combobox---howto-eliminate-the-optional-text-field--tp15045084p15045084.html Sent from the Struts - User mailing list archive at Nabble.com. - 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]
Changing the location of the ajax validation error
Hi, I am stating the use of struts 2 and I would to know how can I customize the ajax validation errors. I know how to customize the style but I would like to customize the location of the error that will appear At the moment it appears only at the op of the textfield, I would like to change the location (lets say to the right of the textfield) Do you know how it can be done? Regards, Mark Levitsky Amdocs Self Service +972-9-7960880(desk) This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement, you may review at http://www.amdocs.com/email_disclaimer.asp
Re: struts request encoding to utf-8 problem
In this case, you've isolated your problem to the database read/write phase, which means it's not a Struts issue. You'll need to look again at your database configuration and whatever middleware you're using to communicate with it (e.g. JDBC, Hibernate). The specifics will depend on your database backend, the middleware you're using and your own persistence code and configuration. L. well i don't think that's the problem in database configuration as there're other projects works with it fine concerning middleware, i'm using JDBC but i donno what should i do to make JDBC middleware compatible with utf-8 encoding here's a snapet of JDBC connection i used .. public Connection dbConnect(String db_connect_string,String db_userid, String db_password) { try { Connection conn = DriverManager.getConnection( db_connect_string, db_userid, db_password); System.out.println(connected); return conn; } catch (Exception e) { e.printStackTrace(); return null; } } public String getText() { String text = ; Statement statement = null; try { Connection conn = dbConnect(jdbc:oracle:thin:@localhost:1522:fat10g, test, t); statement = conn.createStatement(); String query = select * from test; ResultSet resultSet = statement.executeQuery ( query ) ; // get the last entered row in test table while ( resultSet.next () ) { text = resultSet.getString(test); } // text = new String(text.getBytes(), UTF-8); } catch(Exception e) { e.printStackTrace(); } finally //ensure statement is closed properly { try { statement.close () ; } catch ( SQLException e ) { } } return text; } public void saveText(String text) { Statement statement = null; try { Connection conn = dbConnect(jdbc:oracle:thin:@localhost:1522:fat10g, test, t); statement = conn.createStatement(); String query = insert into TEST (test) values (' + text + '); boolean result = statement.execute( query ) ; } catch(SQLException e) { e.printStackTrace(); } finally //ensure statement is closed properly { try { statement.close () ; } catch ( SQLException e ) {} } } what should i do to middleware ? -- View this message in context: http://www.nabble.com/struts-request-encoding-to-utf-8-problem-tp15041079p15061172.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Combining the iterator tag with the tree tag (problem with label field)
Hi All, I'm new in struts and I can't solve a little problem... I'm trying to populating a tree with data from a database, and I'd like to do that using the iterator tag. My code is the following one: s:tree theme = ajax id = root label = Reservations s:iterator value = reservations s:treenode theme = ajax label=Reservation ID: s:property value = rid/ s:treenode theme = ajax label=Is a pre-reservation? : s:property value = isPre// s:treenode theme = ajax label=Services s:iterator value = services s:treenode theme = ajax label=s:property value=sid/ / s:treenode theme = ajax label=Automatic activation: s:property value=automaticActivation// /s:iterator /s:treenode /s:treenode /s:iterator /s:tree The definition of the data type reservations: Reservation[] reservation int rid; boolean is Pre; Service[] services; int sid; boolean automaticActivation; The problem is the LABEL field that only allows Strings. I'd like to fill this field with the evaluation of the iterator property. Can someone help me? I've looking for this in many tutorials, forums... but I haven't found anything... Thanks in advance! -- View this message in context: http://www.nabble.com/Combining-the-iterator-tag-with-the-tree-tag-%28problem-with-label-field%29-tp15061806p15061806.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
setting dynamic dispatch action from submit button with custom ActionMapper
Hi, I have created one Custom ActionMapper for custom urls. Now I want to use this custom action mapper with dynamic dispatch action for method setting. Here is code for jsp file s:submit value=Search action=user_pagedSearching/ Here is for struts.xml action name=user_* class=isp.action.UserList method={1} result name=searchUserList.jsp/result /action how can I setMethod as pagedSearching method in MyCustomActionMapper. Can any one help? Thanks Neha Bhatt -- View this message in context: http://www.nabble.com/setting-dynamic-dispatch-action-from-submit-button-with-custom-ActionMapper-tp15062866p15062866.html 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: Tiles 2.0.5 Error : java.lang.NoSuchMethodError: org.apache.tiles.TilesContainer.render
2008/1/24, Jayakrishnan KR [EMAIL PROTECTED]: I am using Tiles 2.0.5 with Struts 2.0.6 Struts 2.0.6 is not compatible with Tiles 2.0.5. Please upgrade to Struts 2.0.11. Antonio
AW: struts2/dojo: duplicate events (struts 2.0.11)
hi, has no one an idea? kind regards, frank -Ursprüngliche Nachricht- Von: Otto, Frank [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 23. Januar 2008 12:18 An: 'user@struts.apache.org' Betreff: struts2/dojo: duplicate events (struts 2.0.11) hi, I have a ajax div (div1) in another ajax div (divGrp1). I publish the event refreshDivGrp1 to divGrp1, the div1 was recreate and the event refreshDiv1 was subscribed twice. Here are the debug messages: DEBUG: [divGrp1] Listening to refreshDivGrp1 to refresh DEBUG: [div1] Listening to refreshDiv1 to refresh DEBUG: [div1] Listening to refreshDiv1 to refresh Now, if the event refreshDiv1 was published, the notifyTopics of div1 will be send twice too. My code: s:div theme=ajax id=divGrp1 href=%{myURL} executeScripts=true listenTopics=refreshDivGrp1 / ... s:div theme=ajax href=%{myURL} listenTopics=refreshDiv1 notifyTopics=otherEvent id=div1 executeScripts=true ... /s:div /s:div If I create the div1 three or more times, the otherEvent was called three or more too. Is this a bug of struts2/dojo? Is there a workaround? kind regards, frank
Re: Java Script in JSP pages
Hi, I think it is better to use like this: script type=text/javascript src='html:rewrite page=/Calendar/calendarDateinput.js/'/script in the browser will appear (the absolute path): script type=text/javascript src='/yourContextName/Calendar/calendarDateinput.js'/script - Original Message - From: Randy Burgess [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Wednesday, January 23, 2008 6:37 PM Subject: Re: Java Script in JSP pages Try this. script type=text/javascript src=Calendar/calendarDateInput.js /script You need to check your file paths and understand relative links in your web application. If that isn't it then you will have to figure it out. The syntax is correct. Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications From: naveen k [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org Date: Wed, 23 Jan 2008 14:27:34 +0300 To: Struts Users Mailing List user@struts.apache.org Subject: Re: Java Script in JSP pages Thanks for ur reply. I have Jason's Calendar code which run calendar.js script. I need to set that in my JSP page i could not da that. I have done the same thing in html page. I was trying to do like this %@ page language=java pageEncoding=UTF-8% %@ taglib uri=http://jakarta.apache.org/struts/tags-bean; prefix=bean % %@ taglib uri=http://jakarta.apache.org/struts/tags-html; prefix=html % %@ taglib uri=http://jakarta.apache.org/struts/tags-logic; prefix=logic % %@ taglib uri=http://jakarta.apache.org/struts/tags-tiles; prefix=tiles % %@ taglib uri=http://jakarta.apache.org/struts/tags-template; prefix=template % %@ taglib uri=http://jakarta.apache.org/struts/tags-nested; prefix=nested % !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html:html locale=true head html:base / script type=text/javascript src=/Calendar/calendarDateInput.js /script /head body html:form action=/Action p align=centerfont size=5 color=blackMaster/font/p div align=center center table tr td align=right Effective from Date /td td align=left script DateInput('orderdate', true, 'DD-MON-')/script !-- html:text property=effectiveDateFrom size=30 maxlength=30/ -- /td /tr /table /center /div/html:form /body /html:html Except that calendar every thing is seen in that Jsp page. I didnot understand where the problem lies. Naveen. On Jan 23, 2008 2:19 PM, Antonio Petrelli [EMAIL PROTECTED] wrote: 2008/1/23, naveen k [EMAIL PROTECTED]: I am in a development of struts web application. I need to use java script in a jsp page. but i could not do that. cant we use java script in jsp pages? If possible how would i do that? You can put Javascript in your JSP page, what's your problem? Antonio - 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]
How To deploy struts showcase application in Netbeans
HI Sorry for asking silly quesstion ,i have downloaded showcase.war file from struts site,can any body tell me how to deploy that file in netbean.awaiting for ur reply - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How To deploy struts showcase application in Netbeans
Hi, for my understanding NetBean is an IDE and if you have the project setup in NetBean you can run it with the application server/ servlet container you have configured in there. what i would suggest is to deploy this .war file in Tomcat. Thanks, Nuwan (http://code.google.com/p/struts2-ssl-plugin/) mohammed hussain wrote: HI Sorry for asking silly quesstion ,i have downloaded showcase.war file from struts site,can any body tell me how to deploy that file in netbean.awaiting for ur reply - 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: Java Script in JSP pages
sorry friend this was also not working. Naveen On Jan 24, 2008 3:07 PM, Alexandru BARBAT [EMAIL PROTECTED] wrote: Hi, I think it is better to use like this: script type=text/javascript src='html:rewrite page=/Calendar/calendarDateinput.js/'/script in the browser will appear (the absolute path): script type=text/javascript src='/yourContextName/Calendar/calendarDateinput.js'/script - Original Message - From: Randy Burgess [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Wednesday, January 23, 2008 6:37 PM Subject: Re: Java Script in JSP pages Try this. script type=text/javascript src=Calendar/calendarDateInput.js /script You need to check your file paths and understand relative links in your web application. If that isn't it then you will have to figure it out. The syntax is correct. Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications From: naveen k [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org Date: Wed, 23 Jan 2008 14:27:34 +0300 To: Struts Users Mailing List user@struts.apache.org Subject: Re: Java Script in JSP pages Thanks for ur reply. I have Jason's Calendar code which run calendar.js script. I need to set that in my JSP page i could not da that. I have done the same thing in html page. I was trying to do like this %@ page language=java pageEncoding=UTF-8% %@ taglib uri=http://jakarta.apache.org/struts/tags-bean; prefix=bean % %@ taglib uri=http://jakarta.apache.org/struts/tags-html; prefix=html % %@ taglib uri=http://jakarta.apache.org/struts/tags-logic; prefix=logic % %@ taglib uri=http://jakarta.apache.org/struts/tags-tiles; prefix=tiles % %@ taglib uri=http://jakarta.apache.org/struts/tags-template; prefix=template % %@ taglib uri=http://jakarta.apache.org/struts/tags-nested; prefix=nested % !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html:html locale=true head html:base / script type=text/javascript src=/Calendar/calendarDateInput.js /script /head body html:form action=/Action p align=centerfont size=5 color=blackMaster/font/p div align=center center table tr td align=right Effective from Date /td td align=left script DateInput('orderdate', true, 'DD-MON-')/script !-- html:text property=effectiveDateFrom size=30 maxlength=30/ -- /td /tr /table /center /div/html:form /body /html:html Except that calendar every thing is seen in that Jsp page. I didnot understand where the problem lies. Naveen. On Jan 23, 2008 2:19 PM, Antonio Petrelli [EMAIL PROTECTED] wrote: 2008/1/23, naveen k [EMAIL PROTECTED]: I am in a development of struts web application. I need to use java script in a jsp page. but i could not do that. cant we use java script in jsp pages? If possible how would i do that? You can put Javascript in your JSP page, what's your problem? Antonio - 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: Java Script in JSP pages
2008/1/24, naveen k [EMAIL PROTECTED]: sorry friend this was also not working. Why don't you contact Jason's calendar developers then? Stop this thread, it's off-topic here. Antonio
Re: Java Script in JSP pages
:) ok So my advice is to write in browser http://yourserver:port/context/calendarDateinput.js and hit enter.. if popup download window appear with that js file it means the problem is elsewhere not in jsp-struts. - Original Message - From: naveen k [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Thursday, January 24, 2008 2:58 PM Subject: Re: Java Script in JSP pages sorry friend this was also not working. Naveen On Jan 24, 2008 3:07 PM, Alexandru BARBAT [EMAIL PROTECTED] wrote: Hi, I think it is better to use like this: script type=text/javascript src='html:rewrite page=/Calendar/calendarDateinput.js/'/script in the browser will appear (the absolute path): script type=text/javascript src='/yourContextName/Calendar/calendarDateinput.js'/script - Original Message - From: Randy Burgess [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Wednesday, January 23, 2008 6:37 PM Subject: Re: Java Script in JSP pages Try this. script type=text/javascript src=Calendar/calendarDateInput.js /script You need to check your file paths and understand relative links in your web application. If that isn't it then you will have to figure it out. The syntax is correct. Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications From: naveen k [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org Date: Wed, 23 Jan 2008 14:27:34 +0300 To: Struts Users Mailing List user@struts.apache.org Subject: Re: Java Script in JSP pages Thanks for ur reply. I have Jason's Calendar code which run calendar.js script. I need to set that in my JSP page i could not da that. I have done the same thing in html page. I was trying to do like this %@ page language=java pageEncoding=UTF-8% %@ taglib uri=http://jakarta.apache.org/struts/tags-bean; prefix=bean % %@ taglib uri=http://jakarta.apache.org/struts/tags-html; prefix=html % %@ taglib uri=http://jakarta.apache.org/struts/tags-logic; prefix=logic % %@ taglib uri=http://jakarta.apache.org/struts/tags-tiles; prefix=tiles % %@ taglib uri=http://jakarta.apache.org/struts/tags-template; prefix=template % %@ taglib uri=http://jakarta.apache.org/struts/tags-nested; prefix=nested % !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html:html locale=true head html:base / script type=text/javascript src=/Calendar/calendarDateInput.js /script /head body html:form action=/Action p align=centerfont size=5 color=blackMaster/font/p div align=center center table tr td align=right Effective from Date /td td align=left script DateInput('orderdate', true, 'DD-MON-')/script !-- html:text property=effectiveDateFrom size=30 maxlength=30/ -- /td /tr /table /center /div/html:form /body /html:html Except that calendar every thing is seen in that Jsp page. I didnot understand where the problem lies. Naveen. On Jan 23, 2008 2:19 PM, Antonio Petrelli [EMAIL PROTECTED] wrote: 2008/1/23, naveen k [EMAIL PROTECTED]: I am in a development of struts web application. I need to use java script in a jsp page. but i could not do that. cant we use java script in jsp pages? If possible how would i do that? You can put Javascript in your JSP page, what's your problem? Antonio - 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: [S2] fieldError - highlight input field using simple theme?
s:if test=getFieldErrors().get('name') != null I'd probably urge you to modify an existing template or create your own, though. d. --- Rubens [EMAIL PROTECTED] wrote: I have a form with multiple input fields, and I am using the simple theme. Is it possible to determine (maybe using s:if..) when a given field fails validation? I already tried hasFieldErrors(); however, hasFieldErrors() does not allow me to distinguish which field on the form fails. Here is what I want: s:form method=POST action=login_doLogin validate=true cssClass=homeLoginForm fieldset s:actionerror / label for=loginId s:text name=label.loginId / /label s:if test=field loginId is okay -- what do I put here??? s:textfield required=true id=loginId name=loginId size=25 maxlength=100 / /s:if s:else s:textfield required=true id=loginId name=loginId size=25 maxlength=100 cssClass=error / /s:else s:fielderror name=loginId s:paramloginId/s:param /s:fielderror label for=password s:text name=label.password / /label s:if test=field password is okay -- what do I put here??? s:password required=true id=password name=password size=25 maxlength=10 showPassword=true / /s:if s:else s:password required=true id=password name=password size=25 maxlength=10 showPassword=true cssClass=error / /s:else s:fielderror s:parampassword/s:param /s:fielderror s:submit key=button.signIn type=submit / /fieldset /s:form -- View this message in context: http://www.nabble.com/-S2--fieldError---highlight-input-field-using-%22simple%22-theme--tp15060201p15060201.html Sent from the Struts - User mailing list archive at Nabble.com. - 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]
[OT] Re: Java Script in JSP pages
--- Martin Gainty [EMAIL PROTECTED] wrote: Dojo uses registerModulePath to associate the package with the folder e.g. script dojo.registerModulePath(foo, tests/_base/_loader/744/foo); dojo.require(foo.bar); will properly locate packagename.javascript file you were looking for Dojo? He's using http://calendar.moonscript.com/dateinput.cfm, AFAICT. d. M- - Original Message - From: Alexandru BARBAT [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Thursday, January 24, 2008 8:10 AM Subject: Re: Java Script in JSP pages :) ok So my advice is to write in browser http://yourserver:port/context/calendarDateinput.js and hit enter.. if popup download window appear with that js file it means the problem is elsewhere not in jsp-struts. - Original Message - From: naveen k [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Thursday, January 24, 2008 2:58 PM Subject: Re: Java Script in JSP pages sorry friend this was also not working. Naveen On Jan 24, 2008 3:07 PM, Alexandru BARBAT [EMAIL PROTECTED] wrote: Hi, I think it is better to use like this: script type=text/javascript src='html:rewrite page=/Calendar/calendarDateinput.js/'/script in the browser will appear (the absolute path): script type=text/javascript src='/yourContextName/Calendar/calendarDateinput.js'/script - Original Message - From: Randy Burgess [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Wednesday, January 23, 2008 6:37 PM Subject: Re: Java Script in JSP pages Try this. script type=text/javascript src=Calendar/calendarDateInput.js /script You need to check your file paths and understand relative links in your web application. If that isn't it then you will have to figure it out. The syntax is correct. Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications From: naveen k [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org Date: Wed, 23 Jan 2008 14:27:34 +0300 To: Struts Users Mailing List user@struts.apache.org Subject: Re: Java Script in JSP pages Thanks for ur reply. I have Jason's Calendar code which run calendar.js script. I need to set that in my JSP page i could not da that. I have done the same thing in html page. I was trying to do like this %@ page language=java pageEncoding=UTF-8% %@ taglib uri=http://jakarta.apache.org/struts/tags-bean; prefix=bean % %@ taglib uri=http://jakarta.apache.org/struts/tags-html; prefix=html % %@ taglib uri=http://jakarta.apache.org/struts/tags-logic; prefix=logic % %@ taglib uri=http://jakarta.apache.org/struts/tags-tiles; prefix=tiles % %@ taglib uri=http://jakarta.apache.org/struts/tags-template; prefix=template % %@ taglib uri=http://jakarta.apache.org/struts/tags-nested; prefix=nested % !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html:html locale=true head html:base / script type=text/javascript src=/Calendar/calendarDateInput.js /script /head body html:form action=/Action p align=centerfont size=5 color=blackMaster/font/p div align=center center table tr td align=right Effective from Date /td td align=left script DateInput('orderdate', true, 'DD-MON-')/script !-- html:text property=effectiveDateFrom size=30 maxlength=30/ -- /td /tr /table /center /div/html:form /body /html:html Except that calendar every thing is seen in that Jsp page. I didnot understand where the problem lies. Naveen. On Jan 23, 2008 2:19 PM, Antonio Petrelli [EMAIL PROTECTED] wrote: 2008/1/23, naveen k [EMAIL PROTECTED]: I am in a development of struts web application. I need to use java script in a jsp page. but i could not do that. cant we use java script in jsp pages? If possible how would i do that? You can put Javascript in your JSP page, what's your problem? Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For
Re: Java Script in JSP pages
following up on You need to check your file paths and understand relative links in your web application. Dojo uses registerModulePath to associate the package with the folder e.g. script dojo.registerModulePath(foo, tests/_base/_loader/744/foo); dojo.require(foo.bar); will properly locate packagename.javascript file you were looking for M- - Original Message - From: Alexandru BARBAT [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Thursday, January 24, 2008 8:10 AM Subject: Re: Java Script in JSP pages :) ok So my advice is to write in browser http://yourserver:port/context/calendarDateinput.js and hit enter.. if popup download window appear with that js file it means the problem is elsewhere not in jsp-struts. - Original Message - From: naveen k [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Thursday, January 24, 2008 2:58 PM Subject: Re: Java Script in JSP pages sorry friend this was also not working. Naveen On Jan 24, 2008 3:07 PM, Alexandru BARBAT [EMAIL PROTECTED] wrote: Hi, I think it is better to use like this: script type=text/javascript src='html:rewrite page=/Calendar/calendarDateinput.js/'/script in the browser will appear (the absolute path): script type=text/javascript src='/yourContextName/Calendar/calendarDateinput.js'/script - Original Message - From: Randy Burgess [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Wednesday, January 23, 2008 6:37 PM Subject: Re: Java Script in JSP pages Try this. script type=text/javascript src=Calendar/calendarDateInput.js /script You need to check your file paths and understand relative links in your web application. If that isn't it then you will have to figure it out. The syntax is correct. Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications From: naveen k [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org Date: Wed, 23 Jan 2008 14:27:34 +0300 To: Struts Users Mailing List user@struts.apache.org Subject: Re: Java Script in JSP pages Thanks for ur reply. I have Jason's Calendar code which run calendar.js script. I need to set that in my JSP page i could not da that. I have done the same thing in html page. I was trying to do like this %@ page language=java pageEncoding=UTF-8% %@ taglib uri=http://jakarta.apache.org/struts/tags-bean; prefix=bean % %@ taglib uri=http://jakarta.apache.org/struts/tags-html; prefix=html % %@ taglib uri=http://jakarta.apache.org/struts/tags-logic; prefix=logic % %@ taglib uri=http://jakarta.apache.org/struts/tags-tiles; prefix=tiles % %@ taglib uri=http://jakarta.apache.org/struts/tags-template; prefix=template % %@ taglib uri=http://jakarta.apache.org/struts/tags-nested; prefix=nested % !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html:html locale=true head html:base / script type=text/javascript src=/Calendar/calendarDateInput.js /script /head body html:form action=/Action p align=centerfont size=5 color=blackMaster/font/p div align=center center table tr td align=right Effective from Date /td td align=left script DateInput('orderdate', true, 'DD-MON-')/script !-- html:text property=effectiveDateFrom size=30 maxlength=30/ -- /td /tr /table /center /div/html:form /body /html:html Except that calendar every thing is seen in that Jsp page. I didnot understand where the problem lies. Naveen. On Jan 23, 2008 2:19 PM, Antonio Petrelli [EMAIL PROTECTED] wrote: 2008/1/23, naveen k [EMAIL PROTECTED]: I am in a development of struts web application. I need to use java script in a jsp page. but i could not do that. cant we use java script in jsp pages? If possible how would i do that? You can put Javascript in your JSP page, what's your problem? Antonio - 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
Re: File Upload
If I add this script to the end of Plugins.jspx, firebug says: dojo is not defined. How is it possible? script type=text/javascript function fixLinks() { var wid = dojo.widget.byId(removePluginAnchor); alert(wid); } dojo.addOnLoad(fixLinks); /script Pablo Vázquez Blázquez escribió: I always try first in Firefox, you know... And yes, I´m debugging with firebug (what would I do without this tool??). If I begin my Plugins.jspx with jsp:root tag (with no syntax problem, as it works fine when is loaded by ShowPlugins.do action) the load function from the javascript gives me an parse error (I don´t know why) and then, begining it with div and importing all namespaces it also works fine when is loaded by ShowPlugins.do action, but does not work when is loaded as response from a file upload request, because the anchor tags are bad generated (not to use ajax theme) (I don´t know if I have explained the issue fine). Thanks. Jeromy Evans escribió: Sorry Pablo, I'm not sure about this. My suggestions are: - try it in FireFox. If it works, you know you have an IE-specific problem. If it doesn't work, there's something wrong with the code - innerHTML is known to have quirks in IE. I'd simplify the HTML result and work upwards from plain text to find the specific combination of HTML tags that cause the problem (not JSP-tags, the generated HTML) I'm not likely to find anything looking at the JSP. You'll have to debug it at runtime. I always use FireBug to inspect the AJAX result prior to inserting it into the page. Pablo Vázquez Blázquez wrote: Any idea? How can I fix the Delete links problem? Pablo Vázquez Blázquez escribió: Well, if I begin my Plugins.jspx with a div tag, it works (before, the begin was a jsp:root tag). But, when the response is loaded (it is the same page but with a new plugin entry), the delete link is bad created. So, 2 questions: a) why didn´t it work with jsp:root? b) why delete links are bad generated if, when I access normally to the page, they are fine? (Now, they dont work with ajax. I click and go to the whole url). c) Why if I don´t comment the cancel button it doesn´t work? Thanks to everybody who has helped me. I can´t send you my Plugins.jspx because my message is recognized as spam... I would be pleased sending it to you by personal email if you wish. - 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: Tiles 2.0.5 Error : java.lang.NoSuchMethodError: org.apache.tiles.TilesContainer.render
thanks for ur update antanio. On 1/24/08, Antonio Petrelli [EMAIL PROTECTED] wrote: 2008/1/24, Jayakrishnan KR [EMAIL PROTECTED]: I am using Tiles 2.0.5 with Struts 2.0.6 Struts 2.0.6 is not compatible with Tiles 2.0.5. Please upgrade to Struts 2.0.11. Antonio
Noddy struts problem: java.lang.NullPointerException: Module 'null' not found
Dear All, I've been trying to set up a little struts app to play with some actions and whatnot and just as a little exercise and I seem to have rather stumped myself. Essentially I'm getting a java.lang.NullPointerException: Module 'null' not found. Exception when I deploy to Tomcat. However as far as I've figured out, the problem is to do with my struts config as a little further up the stacktrace there is: SEVERE: Servlet /Struts Taster threw load() exception javax.servlet.UnavailableException: Parsing error processing resource path jndi:/localhost/Struts Taster/WEB-INF/struts-config.xml I think I've narrowed it down to a form-bean definition. My spring-config for the form-bean is essentially: form-bean name=personDataForm type=com.pdata.PersonData form-property name=firstname type=java.lang.String / form-property name=lastname type=java.lang.String / form-property name=address type=java.lang.String / form-property name=telephoneNumber type=java.lang.String / /form-bean And 'PersonData' is defined as such... package com.pdata; import org.apache.struts.action.ActionForm; public class PersonData extends ActionForm { private String firstname = null; private String lastname = null; private String address = null; private String telephoneNumber = null; with getters and setters for each field. I'm fairly sure it's this formbean definition as when I comment it out, I get through to the default welcome page just fine. Interestingly, one of my action-mapping entries is: action path=/PersonData forward=/pages/personData.jsp / action path=/Results type=com.pdata.PersonDataAction name=personDataForm scope=request input=/pages/personData.jsp forward name=success path=/pages/results.jsp / forward name=failed path=/pages/error.jsp / /action Now, if I change personDataForm's form-bean definition and remove the 'com.pdata.' part of it, then the app builds within tomcat and deploys, however if I hit /PersonData.do in my browser, I get: javax.servlet.ServletException: Cannot retrieve definition for form bean: personDataForm on action: /Results, which I guess it means it can't compile the form bean definition as it can't find the bean. Commenting out the form-properties has no effect. I'm presuming that I've done something (fairly elementary) wrong. Hopefully this'll be easy for someone to diagnose. Please let me know if you require more information Thanks, Jamie PS, I based most of what I've done on the tutorial at http://www.abqswt.com/tutorials/basicStruts/index.php However I have deviated in a few places as it seems to do a few strange things unnecessarily (like manually copying files about willy nilly). This message should be regarded as confidential. If you have received this email in error please notify the sender and destroy it immediately. Statements of intent shall only become binding when confirmed in hard copy by an authorised signatory. The contents of this email may relate to dealings with other companies within the Detica Group plc group of companies. Detica Limited is registered in England under No: 1337451. Registered offices: Surrey Research Park, Guildford, Surrey, GU2 7YP, England. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP Date Control
Chris, I really love the Unobtrusive Date-Picker Widget at http://www.frequency-decoder.com/2006/10/02/unobtrusive-date-picker-widgit-update I had to make some modifications to it to work better for my site (do not automatically create the object, do not create the inputs or buttons, a few other things that i would be happy to share), but overall, i think it is an excellent implementation. On 1/24/08, Chris Pratt [EMAIL PROTECTED] wrote: This is a tiny bit off topic, but does anyone know a good JSP based Date Control that works well for Birth Dates? Most of the JavaScript libraries with the fancy calendar controls are horrible to enter birthdates (just hit the Previous Year button 45 times). I'm hoping for something that can simply take a date and potentially a range and give a series of select boxes for entering a date. Any luck? (*Chris*) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Noddy struts problem: java.lang.NullPointerException: Module 'null' not found
hi, You don't have to define properties form in struts-config when you use classic ActionForm. it will be enough : ... form-bean name=personDataForm type=com.pdata.PersonData/ ... - Original Message - From: James Cockrill [EMAIL PROTECTED] To: user@struts.apache.org Sent: Thursday, January 24, 2008 6:07 PM Subject: Noddy struts problem: java.lang.NullPointerException: Module 'null' not found Dear All, I've been trying to set up a little struts app to play with some actions and whatnot and just as a little exercise and I seem to have rather stumped myself. Essentially I'm getting a java.lang.NullPointerException: Module 'null' not found. Exception when I deploy to Tomcat. However as far as I've figured out, the problem is to do with my struts config as a little further up the stacktrace there is: SEVERE: Servlet /Struts Taster threw load() exception javax.servlet.UnavailableException: Parsing error processing resource path jndi:/localhost/Struts Taster/WEB-INF/struts-config.xml I think I've narrowed it down to a form-bean definition. My spring-config for the form-bean is essentially: form-bean name=personDataForm type=com.pdata.PersonData form-property name=firstname type=java.lang.String / form-property name=lastname type=java.lang.String / form-property name=address type=java.lang.String / form-property name=telephoneNumber type=java.lang.String / /form-bean And 'PersonData' is defined as such... package com.pdata; import org.apache.struts.action.ActionForm; public class PersonData extends ActionForm { private String firstname = null; private String lastname = null; private String address = null; private String telephoneNumber = null; with getters and setters for each field. I'm fairly sure it's this formbean definition as when I comment it out, I get through to the default welcome page just fine. Interestingly, one of my action-mapping entries is: action path=/PersonData forward=/pages/personData.jsp / action path=/Results type=com.pdata.PersonDataAction name=personDataForm scope=request input=/pages/personData.jsp forward name=success path=/pages/results.jsp / forward name=failed path=/pages/error.jsp / /action Now, if I change personDataForm's form-bean definition and remove the 'com.pdata.' part of it, then the app builds within tomcat and deploys, however if I hit /PersonData.do in my browser, I get: javax.servlet.ServletException: Cannot retrieve definition for form bean: personDataForm on action: /Results, which I guess it means it can't compile the form bean definition as it can't find the bean. Commenting out the form-properties has no effect. I'm presuming that I've done something (fairly elementary) wrong. Hopefully this'll be easy for someone to diagnose. Please let me know if you require more information Thanks, Jamie PS, I based most of what I've done on the tutorial at http://www.abqswt.com/tutorials/basicStruts/index.php However I have deviated in a few places as it seems to do a few strange things unnecessarily (like manually copying files about willy nilly). This message should be regarded as confidential. If you have received this email in error please notify the sender and destroy it immediately. Statements of intent shall only become binding when confirmed in hard copy by an authorised signatory. The contents of this email may relate to dealings with other companies within the Detica Group plc group of companies. Detica Limited is registered in England under No: 1337451. Registered offices: Surrey Research Park, Guildford, Surrey, GU2 7YP, England. - 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]
Building a tree (s:tree)
Hi All! I'm trying to use the tree tag in my web application, but I can't build it from a variable. I've been searching and I've found the showcase example, but these trees are created manually (witting the content of the label). %-| I'd like to populate the tree with data from the database. The following variable is the one that I'd like to list in the tree: Reservation[] reservations; - Reservation contents: int rid; boolean is Pre; Service[] services; - Service contents: int sid; boolean automaticActivation; And I'd like the following result (for example, the test in italics is the one that should be variable): - Reservations - Reservation ID: 1 - isPre: false - Services - ServiceID: 11 - automaticActivation: true - ServiceID: 12 - automaticActivation: false - Reservation ID: 2 - isPre: true - Services - ServiceID: 21 - automaticActivation: true Anybody can help me? Thanks a lot!!!:-) -- View this message in context: http://www.nabble.com/Building-a-tree-%28%3Cs%3Atree%3E%29-tp15068934p15068934.html 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: JSP Date Control
On Jan 24, 2008 7:58 AM, Brian Relph [EMAIL PROTECTED] wrote: Chris, I really love the Unobtrusive Date-Picker Widget at http://www.frequency-decoder.com/2006/10/02/unobtrusive-date-picker-widgit-update I had to make some modifications to it to work better for my site (do not automatically create the object, do not create the inputs or buttons, a few other things that i would be happy to share), but overall, i think it is an excellent implementation. I was hoping for something JSP Taglib based, but that looks really cool, I think I'll give it a try. (*Chris*) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts2 Annotations Validation of an Object's property
Hi, I have an action that has an object of type User as a property. I have a jsp that has a form with several fields, each one targets a property of this User object. How can I use annotations to validate these fields? public class User { private String name; private String email; // getters and setters... } public class MyAction extends ActionSupport { private User user = new User(); public User getUser() { return this.user; } } With the xml solution I would have: field name=user.name field-validator type=requiredstring message key=errors.required.name/ /field-validator /field field name=user.email field-validator type=email message key=errors.required.email/ /field-validator /field How can I use annotations to accomplish the same thing? For simple properties I just do something like this before the setter method: @RequiredStringValidator(message = Please enter your name, trim = true) cheers -- Filipe David Manana, [EMAIL PROTECTED] Obvious facts are like secrets to those not trained to see them. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP Date Control
Chris- Did'nt see support for toggletype? M- - Original Message - From: Chris Pratt [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Thursday, January 24, 2008 11:45 AM Subject: Re: JSP Date Control On Jan 24, 2008 7:58 AM, Brian Relph [EMAIL PROTECTED] wrote: Chris, I really love the Unobtrusive Date-Picker Widget at http://www.frequency-decoder.com/2006/10/02/unobtrusive-date-picker-widgit-u pdate I had to make some modifications to it to work better for my site (do not automatically create the object, do not create the inputs or buttons, a few other things that i would be happy to share), but overall, i think it is an excellent implementation. I was hoping for something JSP Taglib based, but that looks really cool, I think I'll give it a try. (*Chris*) - 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: JSP Date Control
On Jan 24, 2008 9:31 AM, Martin Gainty [EMAIL PROTECTED] wrote: Chris- Did'nt see support for toggletype? M- What's ToggleType? (*Chris*) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP Date Control
I think it's one of the special effects in the s:datetimepicker.../ tag. --- Chris Pratt [EMAIL PROTECTED] wrote: On Jan 24, 2008 9:31 AM, Martin Gainty [EMAIL PROTECTED] wrote: Chris- Did'nt see support for toggletype? M- What's ToggleType? (*Chris*) - 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: Java Script in JSP pages
Yeah that works great with Struts 1. Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications From: Alexandru BARBAT [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org Date: Thu, 24 Jan 2008 14:07:17 +0200 To: Struts Users Mailing List user@struts.apache.org Subject: Re: Java Script in JSP pages Hi, I think it is better to use like this: script type=text/javascript src='html:rewrite page=/Calendar/calendarDateinput.js/'/script in the browser will appear (the absolute path): script type=text/javascript src='/yourContextName/Calendar/calendarDateinput.js'/script - Original Message - From: Randy Burgess [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Wednesday, January 23, 2008 6:37 PM Subject: Re: Java Script in JSP pages Try this. script type=text/javascript src=Calendar/calendarDateInput.js /script You need to check your file paths and understand relative links in your web application. If that isn't it then you will have to figure it out. The syntax is correct. Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications From: naveen k [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org Date: Wed, 23 Jan 2008 14:27:34 +0300 To: Struts Users Mailing List user@struts.apache.org Subject: Re: Java Script in JSP pages Thanks for ur reply. I have Jason's Calendar code which run calendar.js script. I need to set that in my JSP page i could not da that. I have done the same thing in html page. I was trying to do like this %@ page language=java pageEncoding=UTF-8% %@ taglib uri=http://jakarta.apache.org/struts/tags-bean; prefix=bean % %@ taglib uri=http://jakarta.apache.org/struts/tags-html; prefix=html % %@ taglib uri=http://jakarta.apache.org/struts/tags-logic; prefix=logic % %@ taglib uri=http://jakarta.apache.org/struts/tags-tiles; prefix=tiles % %@ taglib uri=http://jakarta.apache.org/struts/tags-template; prefix=template % %@ taglib uri=http://jakarta.apache.org/struts/tags-nested; prefix=nested % !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html:html locale=true head html:base / script type=text/javascript src=/Calendar/calendarDateInput.js /script /head body html:form action=/Action p align=centerfont size=5 color=blackMaster/font/p div align=center center table tr td align=right Effective from Date /td td align=left script DateInput('orderdate', true, 'DD-MON-')/script !-- html:text property=effectiveDateFrom size=30 maxlength=30/ -- /td /tr /table /center /div/html:form /body /html:html Except that calendar every thing is seen in that Jsp page. I didnot understand where the problem lies. Naveen. On Jan 23, 2008 2:19 PM, Antonio Petrelli [EMAIL PROTECTED] wrote: 2008/1/23, naveen k [EMAIL PROTECTED]: I am in a development of struts web application. I need to use java script in a jsp page. but i could not do that. cant we use java script in jsp pages? If possible how would i do that? You can put Javascript in your JSP page, what's your problem? Antonio - 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]
i18n
hi all, I wanna ask a question about Struts i18n. I have two resource files; ApplicationResources(this contains English words) and ApplicationResources_de. Also I have flag buttons on the top of the page. I want to make multi language support like this: when you login you can see the flags on the top of the page. the default language will be English. you will see English and German flags, then when you click on of the flag, for example German flag, language will change and refresh the page we can see page in German language. Is it possible to make it? If anyone can help me, please send an e-mail? best wishes Volkan TOKMAK _ Yeni nesil Windows Live Servisleri’ne şimdi ulaşın! http://get.live.com
Re: i18n
hi, I've googled a bit and found thiz: session.setAttribute(org.apache.struts.action.LOCALE, *new* Locale(en)); http://forum.java.sun.com/thread.jspa?threadID=573861messageID=2854271 http://www.jguru.com/faq/view.jsp?EID=1057614 ^g^ 2008/1/24 volkan tokmak [EMAIL PROTECTED]: hi all, I wanna ask a question about Struts i18n. I have two resource files; ApplicationResources(this contains English words) and ApplicationResources_de. Also I have flag buttons on the top of the page. I want to make multi language support like this: when you login you can see the flags on the top of the page. the default language will be English. you will see English and German flags, then when you click on of the flag, for example German flag, language will change and refresh the page we can see page in German language. Is it possible to make it? If anyone can help me, please send an e-mail? best wishes Volkan TOKMAK _ Yeni nesil Windows Live Servisleri'ne şimdi ulaşın! http://get.live.com -- Sit tibi terra levis http://yayocaturas.blogspot.com/
is possible to pass a parameter to an interceptor from the xml file?
Hi all, I wonder if it is possible to pass a parameter with a value to an interceptor. Example: I have the following interceptor: interceptor name=authentication class=com.struts.security.AuthenticationInterceptor/ (parameterGivenInXmlFile==4) the implementation is: public String intercept (ActionInvocation invocation) throws Exception { ... if (parameterGivenInXmlFile ==3) //do something } thanks for any input -- View this message in context: http://www.nabble.com/is-possible-to-pass-a-parameter--to-an-interceptor-from-the-xml-file--tp15074977p15074977.html 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: is it possible to pass a parameter to an interceptor from the xml file?
Hi, yes it is possible., just implement a setter and getter method for the parameter you have in the struts.xml file. and it will be available to you in the intercept method. eg:- // in the intercept class.. private String httpPort; public String getHttpPort() { return httpPort; } public void setHttpPort(String httpPort) { this.httpPort = httpPort; } // in the struts.xml interceptor-stack name=SecureStack interceptor-ref name=secure param name=httpPort80/param /interceptor-ref the value 80 will be inject to the variable httpPort in the interceptor class., Thanks, Nuwan. (http://struts2-ssl-plugin.googlecode.com/) xianwinwin wrote: Hi all, I wonder if it is possible to pass a parameter with a value to an interceptor. Example: I have the following interceptor: interceptor name=authentication class=com.struts.security.AuthenticationInterceptor/ (parameterGivenInXmlFile==4) the implementation is: public String intercept (ActionInvocation invocation) throws Exception { ... if (parameterGivenInXmlFile ==3) //do something } thanks for any input - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tags in validation.xml
Hi, I am trying to understand how to use the arg.. tag in my validator. 1. What is the significance of using a 'name' inside the arg tag ? 2. How to use it (should the value of the name attribute be same as the rules defined in the depends attribute) and when to use it ? 3. Can it be omitted or it's been made mandatory by the rules ? 4. How can I know what should be the var-name for a rule or can I give anything I want. (user defined) ? field property=age depends=required,integer,intRange arg0 key=employee.age/ arg1 name=intRange key=${var:min} resource=false/ arg2 name=intRange key=${var:max} resource=false/ varvar-namemin/var-namevar-value18/var-value/var varvar-namemax/var-namevar-value65/var-value/var /field Thanks in Advance. -Jerry -- Notice: This e-mail message, together with any attachments, contains information of Merck Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. --
tag writers resources?
Hi All, Does anyone (know of/have any) resources that cover writing a tag? I want to write a struts2 body tag that sets some applications specific state before it emits it's body, and clears the state once the body has been emitted. Any tag-writers guides out there??? thanks in advance, - darren. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: is possible to pass a parameter to an interceptor from the xml file?
On Jan 24, 2008 1:04 PM, xianwinwin [EMAIL PROTECTED] wrote: Hi all, I wonder if it is possible to pass a parameter with a value to an interceptor. Example: I have the following interceptor: interceptor name=authentication class=com.struts.security.AuthenticationInterceptor/ (parameterGivenInXmlFile==4) the implementation is: public String intercept (ActionInvocation invocation) throws Exception { ... if (parameterGivenInXmlFile ==3) //do something } thanks for any input If you need the parameters on a per action basis, you can use: param name=parameterGivenInXmlFile3/param inside the action tag in your struts.xml file. Then in your interceptor you can access the parameter using: invocation.getProxy().getConfig().getParams().get(parameterGivenInXmlFile); I'm not sure if you can use the param tag inside the interceptor, but that might be possible as well. (*Chris*) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts2 Validation
Hello , I am new to struts2. Please help me on this problem. I have a configuration like this action name=Action1.* method={1} class=ActionClass1 result name=summary/page1.jsp/result result name=detail/page2.jsp/result /action action name=Action2.* method={1} class=ActionClass2 result name=summary/page1.jsp/result result name=detail/page2.jsp/result result name=input/page2.jsp/result /action The flow is I submit a form from page1 to Action ActionClass2.edit method, public String edit() throws Exception { // fetch some data and push into session for rendering page2.jsp ... return detail; // This will forward to page2.jsp } You can see from the code that edit() method try to store some data in session for displaying page2.jsp. Everything works fine until i added ActionClass2-validation.xml for validating the form on page2.jsp. I got error says No result defined for action and result input. so I added result name=inputpage2.jsp/result into configuration. and then of course it just simply try to display page2.jsp without having data preloaded by edit() because edit() not get called at all. How can I work around with this problem? Thanks in advance. Kevin -- View this message in context: http://www.nabble.com/Struts2-Validation-tp15079124p15079124.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts2+MyEclipse
Hi All, Please tell me is it possible to develop Struts2 applications using latest version of MyEclipse as i came to know that even the latest version of eclipse support only Struts 1.3. Any Guidance in this regard is much appriciated.
Re: is it possible to pass a parameter to an interceptor from the xml file?
hi, i think whats not possible is ... param name=...${actionclass'sVariable} /.. ... i.e. getting the variable form action calss and accessing it or evaluating an expression as the param value. any ideas how this is possible cheers, ravi nuwan chandrasoma-2 wrote: Hi, yes it is possible., just implement a setter and getter method for the parameter you have in the struts.xml file. and it will be available to you in the intercept method. eg:- // in the intercept class.. private String httpPort; public String getHttpPort() { return httpPort; } public void setHttpPort(String httpPort) { this.httpPort = httpPort; } // in the struts.xml interceptor-stack name=SecureStack interceptor-ref name=secure 80 /interceptor-ref the value 80 will be inject to the variable httpPort in the interceptor class., Thanks, Nuwan. (http://struts2-ssl-plugin.googlecode.com/) xianwinwin wrote: Hi all, I wonder if it is possible to pass a parameter with a value to an interceptor. Example: I have the following interceptor: interceptor name=authentication class=com.struts.security.AuthenticationInterceptor/ (parameterGivenInXmlFile==4) the implementation is: public String intercept (ActionInvocation invocation) throws Exception { ... if (parameterGivenInXmlFile ==3) //do something } thanks for any input - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/is-it-possible-to-pass-a-parameter--to-an-interceptor-from-the-xml-file--tp15074977p15080834.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Type converters: please help!!! :(
hi, i badly need the solution to this problem. i had posted this issue on xwork forums, struts fourms previously also, but hardluck: no reply :( i am reposting the same again... atleast let me know if this idea itself is wrong!!! or any better approach/ is there? ravi_eze wrote: hi, We have Action class with Employee Object with setters and getters. The Typeconverter was configured to be called when EmployeeObject.empId is called by the jsp page. We found that convertFromString of type converter is being called but convertToString is never called. Any idea why this is happening? The details are as follows: Type converter: public class LongConverter extends StrutsTypeConverter { public Object convertFromString(Map context, String[] values, Class toClass) { ... } public String convertToString(Map context, Object o) { ... } } in actionClass-conversion.properties located along with the class file in the same package: employee.empId=com.comp.util.converter.LongConverter After some debugging we found that we need to add a new file: Employee-conversion.properties in the same package of Employee class with entries: empId=com.comp.util.converter.LongConverter and only then the convertToString would be called. I think we should have only one conversion.prop file instead of 2. Any ideas why this is happening this way? or am i missing any thing? please help. cheers, ravi -- View this message in context: http://www.nabble.com/Type-converters%3A-convertToString-not-called-tp15034925p15080943.html 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: Struts2 Validation
Kevin, You didn't mention what page has the form you're submitting, but let me call that page0. Let's say it has two buttons: Button1 for Action1, and Button2 for Action2. I'm assuming that you entered data and hit Button2, and this worked fine until you added the validation descriptor for Action2. The fact that it did stop working, and that it's trying to handle input, says there was a vaidation failure. Trying to coerce input to take you to page2 isn't likely to help, since on the validation failure the action isn't invoked, so edit() is never called. So, I have to assume that, from the data you entered, you didn't *expect* validation to fail. I'd suggest you review the validation you added, especially if there are any custom validators - maybe there's a combination of validators on some field that can never evaluate to true. If there's nothing obvious then I'd suggest adding an actionerror or some fielderror tags to page0, and let it redisplay so you can see what field is failing validation. ...Jeff -Original Message- From: djia002 [mailto:[EMAIL PROTECTED] Sent: Thursday, January 24, 2008 8:14 PM To: user@struts.apache.org Subject: Struts2 Validation Hello , I am new to struts2. Please help me on this problem. I have a configuration like this action name=Action1.* method={1} class=ActionClass1 result name=summary/page1.jsp/result result name=detail/page2.jsp/result /action action name=Action2.* method={1} class=ActionClass2 result name=summary/page1.jsp/result result name=detail/page2.jsp/result result name=input/page2.jsp/result /action The flow is I submit a form from page1 to Action ActionClass2.edit method, public String edit() throws Exception { // fetch some data and push into session for rendering page2.jsp ... return detail; // This will forward to page2.jsp } You can see from the code that edit() method try to store some data in session for displaying page2.jsp. Everything works fine until i added ActionClass2-validation.xml for validating the form on page2.jsp. I got error says No result defined for action and result input. so I added result name=inputpage2.jsp/result into configuration. and then of course it just simply try to display page2.jsp without having data preloaded by edit() because edit() not get called at all. How can I work around with this problem? Thanks in advance. Kevin -- View this message in context: http://www.nabble.com/Struts2-Validation-tp15079124p15079124.html Sent from the Struts - User mailing list archive at Nabble.com. - 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: Type converters: please help!!! :(
Ravi, From my understanding of OGNL, it *should* use the model object's conversion descriptor. It's probably more surprising that it called convertFromString without it. Are you using defaultStack? I believe providing the model object's descriptor is the correct approach, and you indicate that it's working. So why the long face? ;-) -Original Message- From: ravi_eze [mailto:[EMAIL PROTECTED] Sent: Thursday, January 24, 2008 11:45 PM To: user@struts.apache.org Subject: Type converters: please help!!! :( hi, i badly need the solution to this problem. i had posted this issue on xwork forums, struts fourms previously also, but hardluck: no reply :( i am reposting the same again... atleast let me know if this idea itself is wrong!!! or any better approach/ is there? ravi_eze wrote: hi, We have Action class with Employee Object with setters and getters. The Typeconverter was configured to be called when EmployeeObject.empId is called by the jsp page. We found that convertFromString of type converter is being called but convertToString is never called. Any idea why this is happening? The details are as follows: Type converter: public class LongConverter extends StrutsTypeConverter { public Object convertFromString(Map context, String[] values, Class toClass) { ... } public String convertToString(Map context, Object o) { ... } } in actionClass-conversion.properties located along with the class file in the same package: employee.empId=com.comp.util.converter.LongConverter After some debugging we found that we need to add a new file: Employee-conversion.properties in the same package of Employee class with entries: empId=com.comp.util.converter.LongConverter and only then the convertToString would be called. I think we should have only one conversion.prop file instead of 2. Any ideas why this is happening this way? or am i missing any thing? please help. cheers, ravi -- View this message in context: http://www.nabble.com/Type-converters%3A-convertToString-not-called-tp150349 25p15080943.html Sent from the Struts - User mailing list archive at Nabble.com. - 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: Type converters: please help!!! :(
Thank you Jeff for the reply. did u mean the *converter* attribute of the action tag that we give in struts.xml? I didnt give any such attribute in it. I added ActionClass-conversion.properties: in which i mentioned the attribute to pickup a class which implements convertFromString and viceversa functions. My action tag in the xml are as follows: struts package name=eventsCreation namespace=/event extends=struts-default interceptors interceptor name=... class=... / interceptor name=... class=... / /interceptors action name=oneAct class=oneClass interceptor-ref name=... ... /interceptor-ref resultone.jsp/result /action ... let me know if you are looking for anything else. cheers, ravi Jeff Hill (RR) wrote: Ravi, From my understanding of OGNL, it *should* use the model object's conversion descriptor. It's probably more surprising that it called convertFromString without it. Are you using defaultStack? I believe providing the model object's descriptor is the correct approach, and you indicate that it's working. So why the long face? ;-) -Original Message- From: ravi_eze [mailto:[EMAIL PROTECTED] Sent: Thursday, January 24, 2008 11:45 PM To: user@struts.apache.org Subject: Type converters: please help!!! :( hi, i badly need the solution to this problem. i had posted this issue on xwork forums, struts fourms previously also, but hardluck: no reply :( i am reposting the same again... atleast let me know if this idea itself is wrong!!! or any better approach/ is there? ravi_eze wrote: hi, We have Action class with Employee Object with setters and getters. The Typeconverter was configured to be called when EmployeeObject.empId is called by the jsp page. We found that convertFromString of type converter is being called but convertToString is never called. Any idea why this is happening? The details are as follows: Type converter: public class LongConverter extends StrutsTypeConverter { public Object convertFromString(Map context, String[] values, Class toClass) { ... } public String convertToString(Map context, Object o) { ... } } in actionClass-conversion.properties located along with the class file in the same package: employee.empId=com.comp.util.converter.LongConverter After some debugging we found that we need to add a new file: Employee-conversion.properties in the same package of Employee class with entries: empId=com.comp.util.converter.LongConverter and only then the convertToString would be called. I think we should have only one conversion.prop file instead of 2. Any ideas why this is happening this way? or am i missing any thing? please help. cheers, ravi -- View this message in context: http://www.nabble.com/Type-converters%3A-convertToString-not-called-tp150349 25p15080943.html Sent from the Struts - User mailing list archive at Nabble.com. - 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/Type-converters%3A-convertToString-not-called-tp15034925p15081469.html 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 method is not called when the page is redirected with actionError
Hi All, I have the following 2 actions defined: action name=list class=mainAction method=initDisplay interceptor-ref name=store RETRIEVE /interceptor-ref interceptor-ref name=defaultStack / result name=input/jsp/main.jsp/result /action action name=addMember class=mainAction method=addMember interceptor-ref name=store STORE /interceptor-ref interceptor-ref name=defaultStack / result name=success type=redirectlist.action/result result name=error type=redirectlist.action/result /action When the addMember.action is called, it will add a member to DB. It will return actionMessage on success and actionError on failure. The page will be redirected back to list.action where the action message/error will be shown. On success, the page will be redirected succesfully, with the method initDisplay called. However, on failure, the page will also be redirected. However, the method initDisplay is never called. Anyone know why is it so and if I have anything set wrongly? Thanks in advance. -- View this message in context: http://www.nabble.com/Action-method-is-not-called-when-the-page-is-redirected-with-actionError-tp15082435p15082435.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]