Re: Struts 1 log out issue
There are multiple ways to do it. one is to write a piece of code where we can use redirect dispatcher for redirecting to the required url. second on click of logout link take the user to a jsp where session is invalidated , after this forward the user to the desired location. Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com On Fri, Mar 19, 2010 at 7:05 PM, Arpan arpan.deb...@gmail.com wrote: No it doesn't work On Fri, Mar 19, 2010 at 6:19 PM, Brian Thompson elephant...@gmail.com wrote: I'm not 100% sure, but ${property-name} might work. -Brian On Fri, Mar 19, 2010 at 3:43 AM, Arpan arpan.deb...@gmail.com wrote: Hi, I our project we need to put a dynamic log out link,which will come from a properties file. While logging out we want to invalidate the session also. I have written a logout action class where i m invalidating and removing the attribute from the session. Then after success in struts-config.xml file I am redirecting to the log out url,which is hard coded. Does any one know how to access properties file constants into struts-config.xml. And should be the best way to do. Thanks - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: How to deploy struts on tomcat
Number of sites that give u ant tutorials, you can also have a look @ http://ant.apache.org/manual/ ps: r u using modjk to bridge apache and tomcat? Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com On Sat, Mar 13, 2010 at 4:59 PM, abhishek jain abhishek.netj...@gmail.comwrote: Hi Girish and Pawal, Thanks for the help, the copy and paste worked, the error i am getting is that the code works on :8080 port and not via apache, Some of the code gets delivered by 80 apache though, the one which is supposed to be worked via web.xml like url rewrite. I guess some error with configuration of apache will look at that, Any pointers to learn Ant. any link? Thanks for the help. thanks abhishek On Thu, Mar 11, 2010 at 8:57 PM, Girish Naik girish.n...@gmail.com wrote: I think that for local dev -deployment we can configure tomcat in eclipse (the same should apply for MyEclipse), by telling the eclipse tomcat home location in the workspace preference. This would deploy ur app in the tomcat as context / xml files as u mention in preference. But for QA, prod or remote deploy, i would suggest you use ant or maven deploy script. Ant is simplest and could be learnt in few hours :) Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com 2010/3/11 Paweł Wielgus poulw...@gmail.com Hi Abhishek, normaly just copying and pasting war should work on tomcat, i can't remeber if tomcat needs to be restarted or it will discover the war automaticaly - check the tomcat server.xml for that. War is a standard, it doesn't matter if it contains struts or spring application inside. As for myeclipse, i don't know if it will autodeploy your app, probably it can. As for ant, You can use it there is nothing wrong with it. Best greetings, Pawel Wielgus. 2010/3/10, abhishek jain abhishek.netj...@gmail.com: Hi friends, I have developed a struts 1 application, i need to know what are the ways and means to deploy a struts application, if i just copy and paste the war application, will it be the correct way? Also if i have myeclipse can it directly deploy on the remote server via FTP(on linux), and is it ok to use ant,i am new to ant. Please advise, Thanks a lot. -- Thanks and kind Regards, Abhishek jain - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Thanks and kind Regards, Abhishek jain +91 9971376767
Re: How to deploy struts on tomcat
I think that for local dev -deployment we can configure tomcat in eclipse (the same should apply for MyEclipse), by telling the eclipse tomcat home location in the workspace preference. This would deploy ur app in the tomcat as context / xml files as u mention in preference. But for QA, prod or remote deploy, i would suggest you use ant or maven deploy script. Ant is simplest and could be learnt in few hours :) Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com 2010/3/11 Paweł Wielgus poulw...@gmail.com Hi Abhishek, normaly just copying and pasting war should work on tomcat, i can't remeber if tomcat needs to be restarted or it will discover the war automaticaly - check the tomcat server.xml for that. War is a standard, it doesn't matter if it contains struts or spring application inside. As for myeclipse, i don't know if it will autodeploy your app, probably it can. As for ant, You can use it there is nothing wrong with it. Best greetings, Pawel Wielgus. 2010/3/10, abhishek jain abhishek.netj...@gmail.com: Hi friends, I have developed a struts 1 application, i need to know what are the ways and means to deploy a struts application, if i just copy and paste the war application, will it be the correct way? Also if i have myeclipse can it directly deploy on the remote server via FTP(on linux), and is it ok to use ant,i am new to ant. Please advise, Thanks a lot. -- Thanks and kind Regards, Abhishek jain - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: S2 Forward to previous view (GoBack)
Suppose the user is in Page 'A' and then he is redirected to 'B', now on page 'B' you want to redirect him to page 'A'. So we can do this by getting the request.getHeader(referer) on the submitting action of page 'A' and store it in page 'B' 's go back button. Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com On Mon, Mar 8, 2010 at 2:34 PM, Marsman mars@gmx.de wrote: Hi! how can I forward to the previous view (for a go back button)? I've read about dynamic results. But how can I determine the view, the user comes from? Or is there an easier way to implement this (without javascript)? Titus -- View this message in context: http://old.nabble.com/S2-Forward-to-previous-view-%28GoBack%29-tp27818680p27818680.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Can this be breaking security ?
Hi, i was just implementing file upload in struts 2.0. When the form with file is submitted, I can see the full path in the path property of file. Can it be possible for any one to get the path and look for any other file in that location of folder? Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com George Carlinhttp://www.brainyquote.com/quotes/authors/g/george_carlin.html - Electricity is really just organized lightning.
Re: Can this be breaking security ?
sorry its not possible to pick files from the clients machine as when a file is uploaded it (someone) creates a tmp file in 'work\Catalina\localhost\context\upload__70e25ce7_121fcf971b2__7ff2_0003.tmp' hmm ... super. Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com George Carlinhttp://www.brainyquote.com/quotes/authors/g/george_carlin.html - Electricity is really just organized lightning. On Sun, Jun 21, 2009 at 11:32 AM, Girish Naik girish.n...@gmail.com wrote: Hi, i was just implementing file upload in struts 2.0. When the form with file is submitted, I can see the full path in the path property of file. Can it be possible for any one to get the path and look for any other file in that location of folder? Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com George Carlinhttp://www.brainyquote.com/quotes/authors/g/george_carlin.html - Electricity is really just organized lightning.
Re: Return to previous page without javascript
Is this issue solved? Can we do something like thishttp://www.velocityreviews.com/forums/t131347-struts-requestprocessor-override.html Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Henny Youngmanhttp://www.brainyquote.com/quotes/authors/h/henny_youngman.html - I told the doctor I broke my leg in two places. He told me to quit going to those places. On Mon, Jun 15, 2009 at 8:11 PM, Stefano Tranquillini stefano.tranquill...@gmail.com wrote: I tried to use request and URI but: - i'm not able to have some result from this command. - how can i set this value inside the session from a jsp. thanks. -- Stefano
Re: File /WEB-INF/tld/struts-bean.tld not found
I would sugest you to remove the taglib configuration in ur web.xml. As it is matching the uri and trying to load from the local file. In my previous application i had given : %@ taglib uri=http://struts.apache.org/tags-bean; prefix=bean % in my jsp header and taglib taglib-uri/tags/struts-bean/taglib-uri taglib-location/WEB-INF/struts-bean.tld/taglib-location /taglib in web.xml And they are working fine. So either you can give : %@ taglib uri=http://struts.apache.org/tags-bean; prefix=bean % or (if u have a local tag lib) %@ taglib uri=/tags/struts-bean prefix=bean % Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Fran Lebowitzhttp://www.brainyquote.com/quotes/authors/f/fran_lebowitz.html - Life is something to do when you can't get to sleep. On Sat, Jun 20, 2009 at 7:42 PM, Sam Wun swun2...@gmail.com wrote: Dear all, Can anyone tell me what is wrong with the following errors: 00:05:59,378 ERROR [PortletRequestDispatcherImpl:316] org.apache.jasper.JasperException: /html/portlet/onlinepayment_portlet/order.jsp(1,1) File /WEB-INF/tld/struts-bean.tld not found org.apache.jasper.JasperException: /html/portlet/onlinepayment_portlet/order.jsp(1,1) File /WEB-INF/tld/struts-bean.tld not found at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) ... I have already defined tag-libs in my web.xml file: taglib taglib-urihttp://struts.apache.org/tags-bean/taglib-uri taglib-location/WEB-INF/tld/struts-bean.tld/taglib-location /taglib of course struts-bean.tld is not in my WEB-INF/tld directory, but I expect it will pick up the file from the lib path like the other sample does. I am sure most of you don't have this file in your project directory. This is the init.jsp file that is included in the order.jsp file: %@ taglib uri=http://java.sun.com/portlet_2_0; prefix=portlet % %@ taglib uri=http://struts.apache.org/tags-bean; prefix=bean % %@ taglib uri=http://struts.apache.org/tags-html; prefix=html % %@ taglib uri=http://struts.apache.org/tags-logic; prefix=logic % %@ page import=javax.portlet.PortletRequest % %@ page import=javax.portlet.PortletSession % Any idea? Your help is very much appreciated. Thanks - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: File /WEB-INF/tld/struts-bean.tld not found
as you dont have the files in WEB-INF can you remove the mapping in web.xml and run again? Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com George Carlinhttp://www.brainyquote.com/quotes/authors/g/george_carlin.html - Electricity is really just organized lightning. On Sat, Jun 20, 2009 at 8:57 PM, Sam Wun swun2...@gmail.com wrote: thanks for the response. I moved the following taglib lines into the /** ***/ area in the jsp file, and the recompile/deploy with ant. It still give me the same errors. Here is the jsp file load the tld files: % /** %@ taglib uri=http://java.sun.com/portlet_2_0; prefix=portlet % %@ taglib uri=http://struts.apache.org/tags-bean; prefix=bean % %@ taglib uri=http://struts.apache.org/tags-html; prefix=html % %@ taglib uri=http://struts.apache.org/tags-logic; prefix=logic % */ % %@ page import=javax.portlet.PortletRequest % %@ page import=javax.portlet.PortletSession % portlet:defineObjects / style type=text/css %@ include file=/css/style.css % /style here is the errors again: 01:23:47,290 INFO [PluginPackageUtil:1347] Checking for available updates 01:23:47,293 INFO [PluginPackageUtil:1391] Finished checking for available updates in 3 ms 01:23:54,476 ERROR [PortletRequestDispatcherImpl:316] org.apache.jasper.JasperException: /html/portlet/onlinepayment_portlet/order.jsp(1,1) File /WEB-INF/tld/struts-bean.tld not found org.apache.jasper.JasperException: /html/portlet/onlinepayment_portlet/order.jsp(1,1) File /WEB-INF/tld/struts-bean.tld not found at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88) at org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:345) at org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:378) at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:486) at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1444) On Sun, Jun 21, 2009 at 1:10 AM, Girish Naikgirish.n...@gmail.com wrote: I would sugest you to remove the taglib configuration in ur web.xml. As it is matching the uri and trying to load from the local file. In my previous application i had given : %@ taglib uri=http://struts.apache.org/tags-bean; prefix=bean % in my jsp header and taglib taglib-uri/tags/struts-bean/taglib-uri taglib-location/WEB-INF/struts-bean.tld/taglib-location /taglib in web.xml And they are working fine. So either you can give : %@ taglib uri=http://struts.apache.org/tags-bean; prefix=bean % or (if u have a local tag lib) %@ taglib uri=/tags/struts-bean prefix=bean % Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Fran Lebowitz http://www.brainyquote.com/quotes/authors/f/fran_lebowitz.html - Life is something to do when you can't get to sleep. On Sat, Jun 20, 2009 at 7:42 PM, Sam Wun swun2...@gmail.com wrote: Dear all, Can anyone tell me what is wrong with the following errors: 00:05:59,378 ERROR [PortletRequestDispatcherImpl:316] org.apache.jasper.JasperException: /html/portlet/onlinepayment_portlet/order.jsp(1,1) File /WEB-INF/tld/struts-bean.tld not found org.apache.jasper.JasperException: /html/portlet/onlinepayment_portlet/order.jsp(1,1) File /WEB-INF/tld/struts-bean.tld not found at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) ... I have already defined tag-libs in my web.xml file: taglib taglib-urihttp://struts.apache.org/tags-bean /taglib-uri taglib-location/WEB-INF/tld/struts-bean.tld/taglib-location /taglib of course struts-bean.tld is not in my WEB-INF/tld directory, but I expect it will pick up the file from the lib path like the other sample does. I am sure most of you don't have this file in your project directory. This is the init.jsp file that is included in the order.jsp file: %@ taglib uri=http://java.sun.com/portlet_2_0; prefix=portlet % %@ taglib uri=http://struts.apache.org/tags-bean; prefix=bean % %@ taglib uri=http://struts.apache.org/tags-html; prefix=html % %@ taglib uri=http://struts.apache.org/tags-logic; prefix=logic % %@ page import=javax.portlet.PortletRequest % %@ page import=javax.portlet.PortletSession % Any idea? Your help is very much appreciated. Thanks - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional
Re: File /WEB-INF/tld/struts-bean.tld not found
can you change the bean id to something different than the property name. and check again. Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Henny Youngmanhttp://www.brainyquote.com/quotes/authors/h/henny_youngman.html - I told the doctor I broke my leg in two places. He told me to quit going to those places. On Sun, Jun 21, 2009 at 10:24 AM, Sam Wun swun2...@gmail.com wrote: Opps. I commented out the taglibs in a jsp file. Added back in, now got antoehr problem with the getters: 14:48:04,429 ERROR [PortletRequestDispatcherImpl:316] org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: No getter method for property: ship ping_address of bean: OrderForm org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: No getter method for property: shipping_address of bean: OrderForm at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) I have the getters/setters in this java file. Here are the relevant files: 1/ order.jsp: %@ include file=/html/portlet/onlinepayment_portlet/init.jsp % bean:define id=shipping_address name=OrderForm property=shipping_address type=java.lang.String / logic:messagesPresent span class=es-error bean:message key=error.shipping_address.invalid/ /span /logic:messagesPresent !-- p align=right a href=portlet:renderURL portletMode=help /Help/a /p -- p align=centre html:form action=/onlinepayment_portlet/order method=post focus=shipping_address table class=stats tr thbean:message key=form.shipping_address//th thhtml:text name=OrderForm property=shipping_address size=50 //th tr thbean:message key=form.billilng_address//th thhtml:text name=OrderForm property=billing_address size=50 //th /tr tr thbean:message key=form.email_address//th thhtml:text name=OrderForm property=email_address size=50 //th /tr tr valign=top thbean:message key=form.firstname//th thhtml:textarea name=OrderForm property=firstname rows=12 cols=50 //th /tr tr valign=top thbean:message key=form.lastname//th thhtml:textarea name=OrderForm property=lastname rows=12 cols=50 //th /tr /table /p p align=left html:submitbean:message key=button.submit//html:submit /html:form /p 2/ OrderForm.java: package com.ip6networks.onlinepayment.portlet; import javax.servlet.http.HttpServletRequest; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionMessage; /** * Search query entry form. * * @struts.form name=OrderForm */ public class OrderForm extends ActionForm{ private String firstname=; private String lastname=; private String email_address=; private String phone_number=; private String shipping_address=; private String billing_address=; /** * Sets the query attribute of the OrderForm object * * @struts.validator type=required msgkey=error.firstname.required * @struts.validator type=required msgkey=error.lastname.required * @struts.validator type=required msgkey=error.email_address.required * @struts.validator type=required msgkey=error.phone_number.required * @struts.validator type=required msgkey=error.shipping_address.required * @struts.validator type=required msgkey=error.billing_address.required */ public void setFirstName(String fn){ this.firstname = fn; } public String getFirstName(){ return this.firstname; } public void setLastName(String ln){ this.lastname = ln; } public String getLastName(){ return this.lastname; } public void setEmailAddress(String email){ this.email_address = email; } public String getEmailAddress(){ return this.email_address; } public void setShippingAddress(String shipping) { this.shipping_address = shipping; } public String getShippingAddress(){ return this.shipping_address; } public void setBillingAddress(String billing) { this.billing_address = billing; } public String getBillingAddress(){ return this.billing_address; } public void setPhoneNumber(String ph) { this.phone_number = ph; } public String getPhoneNumber(){ return this.phone_number
Re: Doubt with using check box
You can look at *Map Backed ActionForms*http://struts.apache.org/1.x/userGuide/building_controller.htmlSection 4.3.3 Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com P. J. O'Rourkehttp://www.brainyquote.com/quotes/authors/p/p_j_orourke.html - If government were a product, selling it would be illegal. On Sun, Jun 21, 2009 at 10:26 AM, Vishnu Vyasan Nelliparmbil vis...@mun.gov.bh wrote: Can anybody help me on this issue? -Original Message- From: Vishnu Vyasan Nelliparmbil [mailto:vis...@mun.gov.bh] Sent: 20 June 2009 13:21 To: Struts Users Mailing List Subject: RE: Doubt with using check box Pawel , can you expalin with a example. I am totally new to struts. I tried with another way. Ie by adding a 'selected' field to the EmployeeBean. logic:iterate id=EmployeeBean name=EMPLOYEE scope=session tr td bean:write name= EmployeeBean property=employee_name //td td bean:write name= EmployeeBean property=employee_salary //td tdhtml:checkbox name= EmployeeBean property=selected onchange=checkEmployee(); /html:checkbox tr /logic:iterate Now I am getting the values of selected as false in the Action. Even though I have selected it. I am using a action form for the some other elements in the same view. Could you guys can through some light on how to make this work? Regards Vishnu -Original Message- From: Paweł Wielgus [mailto:poulw...@gmail.com] Sent: 20 June 2009 10:40 To: Struts Users Mailing List Subject: Re: Doubt with using check box Hi Vishnu, on the html page you will have a list of checkboxes with the same name selectedEmployees and a value of an employee identificator. In the action create settet setSelectedEmloyees(String[] selectedEmployees), then in execute You can access this table of employee identificators. Just as a side note, i don't know what type of is your employee identificator, so i proposed String, but it can also be long. Best greetings, Pawel Wielgus. 2009/6/20, Vishnu Vyasan Nelliparmbil vis...@mun.gov.bh: Hi Friends, I am new to web development and struts. I have a simple question. I am using logic:iterate tag to iterate through a list of Employees and display their details. The list contains the Employee objects. Now while displaying Employee details in a table, the row is ending with a check box , so that the user can select employees. The check boxes are created dynamically since they are inside the iterate tag. Now how in Action I know that a specific employee is selected? In action form I would get whether the check box is selected or not. But how can I relate that to employees in list? Thanks in Advance vishnu - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: File /WEB-INF/tld/struts-bean.tld not found
If your getter is 'getShippingAddress()' then your property will be 'shippingAddress' . Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Fran Lebowitzhttp://www.brainyquote.com/quotes/authors/f/fran_lebowitz.html - Life is something to do when you can't get to sleep. On Sun, Jun 21, 2009 at 11:09 AM, Sam Wun swun2...@gmail.com wrote: getShippingAddress()
Re: drop down list not working after using validation.xml
One of my colleague had done it in some project. But dont know if its the correct way. :( Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Samuel Goldwynhttp://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html - I'm willing to admit that I may not always be right, but I am never wrong. On Fri, Jun 19, 2009 at 5:24 PM, Yanto yantob...@gmail.com wrote: Hi Girish, Is this mean we can load the list again in Action's Preparable method ? currently, we are trying looking at the sample in internet. Thanks Regards Yanto On Thu, Jun 18, 2009 at 10:23 PM, Girish Naik girish.n...@gmail.com wrote: After validation, Action's Preparable method is called, you can load the required list in request again. Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Samuel Goldwyn http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html - I'm willing to admit that I may not always be right, but I am never wrong. On Thu, Jun 18, 2009 at 5:08 PM, Dave Newton newton.d...@yahoo.com wrote: Please consider copying your code snippets into a plain-text editor before including them in an email message: we're getting a blank line between each line and a lot of spurious asterisks. Yanto wrote: *org.apache.jasper.JasperException: tag 'select', field 'list', name 'entityInternalId': The requested list key 'entities' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown location]* without validation xml and application page showing dropdown coming properly. s:select id=*entityInternalId* name=*entityInternalId* list=*entities* headerKey=** headerValue=** listKey=*internalId* listValue=*entityName* / Any one help on this ? Do you load the entities list? Recall that actions are instantiated per-request. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: how to prevent users from directly accessing jsp files
But in that case the css, images, js is compromised rite? What if I want all to be secured? Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Fran Lebowitzhttp://www.brainyquote.com/quotes/authors/f/fran_lebowitz.html - Life is something to do when you can't get to sleep. On Fri, Jun 19, 2009 at 7:15 PM, Greg Lindholm greg.lindh...@gmail.comwrote: I tried putting the below string in web.xml, but all my css, js from the application got blocked. But pages are coming. Is something missing or some extra thing to be done? security-constraint display-namePrevent access to raw pages./display-name web-resource-collection web-resource-nameRaw Pages/web-resource-name url-pattern/struts/*/url-pattern /web-resource-collection auth-constraint descriptionNo roles, so no direct access/description /auth-constraint /security-constraint Regards, - Girish Naik The way this security constraint works is it prevents direct access to the area defined by the url-pattern/struts/*/url-pattern elements (you can have multiple). In this case we put our jsp files under /struts/ folder. You can name the folder whatever you like but only put jsp files in it. You need to put your css and js file someplace else. Our typical layout for webroot is: / css/ images/ js/ struts/ WEB-INF/
Re: Struts2 - CSS problem - Hello World
Is this error comming on app start? Are u sure that this error is due to css? Is your app working when there is no css? If Yes then can u use relative path for calling css instead of s:url Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com George Carlinhttp://www.brainyquote.com/quotes/authors/g/george_carlin.html - Electricity is really just organized lightning. On Fri, Jun 19, 2009 at 7:30 PM, jill juneja jilljun...@gmail.com wrote: All, I am new to struts2. Downloaded and manually configured the helloworld war in JDeveloper. Every thing work fines in the app. I am getting hello world message. Login page, validations using validator. Only thing not work in the app is css file. Its in the root directory under css folder. Any help is very much appreciated. Below is error exception in firefox view css tab. 500 Internal Server Error java.lang.NullPointerExceptionat com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.EvermindHttpServletRequest.getParameters(EvermindHttpServletRequest.java:1471) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.EvermindHttpServletRequest.getImmutableParameters(EvermindHttpServletRequest.java:1565) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.EvermindHttpServletRequest.getParameterMap(EvermindHttpServletRequest.java:1571) at org.apache.struts2.dispatcher.Dispatcher.createContextMap(Dispatcher.java:507) at org.apache.struts2.dispatcher.ng.PrepareOperations.createActionContext(PrepareOperations.java:75) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:65) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.FileRequestDispatcher.handleWithFilter(FileRequestDispatcher.java:137) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.FileRequestDispatcher.unprivileged_forwardInternal(FileRequestDispatcher.java:283) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.FileRequestDispatcher.access$100(FileRequestDispatcher.java:30) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.FileRequestDispatcher$2.oc4jRun(FileRequestDispatcher.java:254) at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:283) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.FileRequestDispatcher.forwardInternal(FileRequestDispatcher.java:259) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:867) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303) at java.lang.Thread.run(Thread.java:595) Include in jsp is head titleSign On/title link href=s:url value=/css/forms.css/ rel=stylesheet type=text/css/ /head web.xml is ?xml version=1.0 encoding=UTF-8? web-app id=WebApp_9 version=2.4 xmlns= http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation= http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; display-nameStruts Blank/display-name filter filter-namestruts2/filter-name filter-classorg.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter/filter-class /filter filter-mapping filter-namestruts2/filter-name url-pattern/*/url-pattern /filter-mapping welcome-file-list welcome-fileindex.html/welcome-file /welcome-file-list /web-app struts.xml ?xml version=1.0 encoding=UTF-8 ? !DOCTYPE struts PUBLIC -//Apache Software Foundation//DTD Struts Configuration 2.0//EN http://struts.apache.org/dtds/struts-2.0.dtd; struts constant name=struts.enable.DynamicMethodInvocation value=false / constant name=struts.devMode value=false / package name=default namespace=/ extends=struts-default default-action-ref name=index / action name=index result type=redirectAction param name=actionNameHelloWorld/param param name=namespace/example/param
Re: how to prevent users from directly accessing jsp files
OMG!! now i need to write a new Web Browser ;) Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Rodney Dangerfieldhttp://www.brainyquote.com/quotes/authors/r/rodney_dangerfield.html - What a dog I got, his favorite bone is in my arm. On Fri, Jun 19, 2009 at 8:43 PM, Greg Lindholm greg.lindh...@gmail.comwrote: On Fri, Jun 19, 2009 at 10:48 AM, Girish Naik girish.n...@gmail.com wrote: But in that case the css, images, js is compromised rite? What if I want all to be secured? Regards, - Girish Naik Wrong. You have to allow direct access the css, image and js files. That's the way web browsers work, ever css, js, and image link you have in a web page is retrieved by your web browser with a separate HTTP GET request.
Re: Struts2 - CSS problem - Hello World
Is CSS applied to pages where there no parameters in the URL of the app? Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Rodney Dangerfieldhttp://www.brainyquote.com/quotes/authors/r/rodney_dangerfield.html - What a dog I got, his favorite bone is in my arm. On Fri, Jun 19, 2009 at 9:50 PM, jill juneja jilljun...@gmail.com wrote: app is working fine. Even if css s:url is there. Css just does not get applied to the pages. I am only seeing the error thru firefox web development tool by viewing css. I know it is weird. I have tried every combination. I tried doing relative path too. Same error. It looks to be it has something to do with filters. On Fri, Jun 19, 2009 at 10:57 AM, Girish Naik girish.n...@gmail.com wrote: Is this error comming on app start? Are u sure that this error is due to css? Is your app working when there is no css? If Yes then can u use relative path for calling css instead of s:url Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com George Carlin http://www.brainyquote.com/quotes/authors/g/george_carlin.html - Electricity is really just organized lightning. On Fri, Jun 19, 2009 at 7:30 PM, jill juneja jilljun...@gmail.com wrote: All, I am new to struts2. Downloaded and manually configured the helloworld war in JDeveloper. Every thing work fines in the app. I am getting hello world message. Login page, validations using validator. Only thing not work in the app is css file. Its in the root directory under css folder. Any help is very much appreciated. Below is error exception in firefox view css tab. 500 Internal Server Error java.lang.NullPointerExceptionat com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.EvermindHttpServletRequest.getParameters(EvermindHttpServletRequest.java:1471) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.EvermindHttpServletRequest.getImmutableParameters(EvermindHttpServletRequest.java:1565) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.EvermindHttpServletRequest.getParameterMap(EvermindHttpServletRequest.java:1571) at org.apache.struts2.dispatcher.Dispatcher.createContextMap(Dispatcher.java:507) at org.apache.struts2.dispatcher.ng.PrepareOperations.createActionContext(PrepareOperations.java:75) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:65) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.FileRequestDispatcher.handleWithFilter(FileRequestDispatcher.java:137) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.FileRequestDispatcher.unprivileged_forwardInternal(FileRequestDispatcher.java:283) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.FileRequestDispatcher.access$100(FileRequestDispatcher.java:30) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.FileRequestDispatcher$2.oc4jRun(FileRequestDispatcher.java:254) at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:283) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.FileRequestDispatcher.forwardInternal(FileRequestDispatcher.java:259) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:867) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303) at java.lang.Thread.run(Thread.java:595) Include in jsp is head titleSign On/title link href=s:url value=/css/forms.css/ rel=stylesheet type=text/css/ /head web.xml is ?xml version=1.0 encoding=UTF-8? web-app id=WebApp_9 version=2.4 xmlns= http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation= http://java.sun.com/xml
Re: Struts2 s:textfield to formatted html
May be you should have a look at the different themes available in struts. Using a simple theme will not generate such unwanted tags. For getting a simple theme you need to put the following parameter in web.xml: context-param param-namecsstheme/param-name param-valuesimplicity/param-value /context-param Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com P. J. O'Rourkehttp://www.brainyquote.com/quotes/authors/p/p_j_orourke.html - If government were a product, selling it would be illegal. On Fri, Jun 19, 2009 at 8:36 PM, ets04uga ets04...@yahoo.com wrote: In looking at the code for the s:textfield tag and it uses the template/simple/text.ftl file as the template. The text.ftl file starts with the html input tag and I'm not understanding where the label, td and tr tags come from such that s:textfield key=user.firstname name=firstName / becomes tr td class=tdLabel label for=updateUser_firstName class=errorLabelFirst Name:/label /td td input type=text name=firstName value= id=updateUser_firstName/ /td /tr Can someone provide a general overview to get me going? Thanks for any guidance, E -- View this message in context: http://www.nabble.com/Struts2-s%3Atextfield-to-formatted-html-tp24113259p24113259.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts2 - CSS problem - Hello World
I am not getting the source of the error, but have few debugging questions: Have you copied the example.xml contents into the struts.xml file? And you have removed or deleted the contents of that (example.xml) file. when you hit '/index' the default action gets called 'index' and when you hit 'index.html' then the file gets invoked and tries to redirect to 'example/HelloWorld.action' (if you have not changed this) and get an error. Else .. I am unable to proceed with out further details of app. :| Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Fran Lebowitzhttp://www.brainyquote.com/quotes/authors/f/fran_lebowitz.html - Life is something to do when you can't get to sleep. On Fri, Jun 19, 2009 at 10:56 PM, jill juneja jilljun...@gmail.com wrote: struts2-blank-2.1.6
Re: Struts 1.3.10 problem
May be this will bring some help: http://wiki.apache.org/struts/StrutsUpgradeNotes12to13 But what i feel is that the app should have been upgraded to 1.2 first then from there to 1.3 ? Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com George Carlinhttp://www.brainyquote.com/quotes/authors/g/george_carlin.html - Electricity is really just organized lightning. On Sat, Jun 20, 2009 at 2:59 AM, Luis Esquivel lesqui...@copera.org wrote: Hello, We are seeing a problem with this version of struts that we haven't been able to resolve. I hope somebody can help. We had an old app in struts 1.1.X and decided to upgrade to 1.3.10. The application that has been working for quite a few years stopped working after doing the upgrade. Here is what happens: I have an action declaration as such - action-mappings action path=/AForm type=com.package.AClassAction name=aForm scope=session input=/AForm.jsp validate=true forward name=success path=/AForm.jsp/ /action /action-mappings When the action gets called, I get a blank page. The only way this works is if I add the redirect=true attribute to the forward tag. The .jsp file in this case AForm.jsp does get called as I can see the logging I added to see if it was even hitting that .jsp. We need it to work without having to specify the redirect=true attribute. I have run the examples that are packaged in the struts 1.3.10 distribution and they all run fine on our server configuration. Does anyone have any idea as to what could be causing this error? If I switch jar files and change the dtd's to the older struts, the application works ok. Any help would be greatly appreciated. Let me know if you need more information than what I have given in this email. Thanks! Luis Esquivel Application Development Public Employees' Retirement Assoc. of Colorado 1300 Logan Street Denver, CO 80203 303 - 837 - 6296
Re: Localization in struts 2
Is the Hindi text specified in the file in UTF8 format? ie /u0092 etc. Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Mitch Hedberghttp://www.brainyquote.com/quotes/authors/m/mitch_hedberg.html - I drank some boiling water because I wanted to whistle. On Thu, Jun 18, 2009 at 10:45 AM, Johnson nickel sarava...@elogic.co.inwrote: Hi all, I have tried the Struts2i18n sample project it's working fine. But i need to implement local language in the same manner. I have created ResourceBundle_Hi.properties for hindi language. I had specified the hindi text in this file. when i try to execute the application it shows some नाम: or ???. It's not actually taken the proper file.Give me a suggestions for this issue -- View this message in context: http://www.nabble.com/Localization-in-struts-2-tp24086510p24086510.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: how to prevent users from directly accessing jsp files
Go to Tomcat Home/conf/web.xml file. in this file put listings as false. init-param param-namelistings/param-name param-valuefalse/param-value /init-param Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Rodney Dangerfieldhttp://www.brainyquote.com/quotes/authors/r/rodney_dangerfield.html - What a dog I got, his favorite bone is in my arm. On Thu, Jun 18, 2009 at 7:11 PM, Greg Lindholm greg.lindh...@gmail.comwrote: We put all our jsp file into a /struts/ folder then add the following security contraint to web.xml security-constraint display-namePrevent access to raw pages./display-name web-resource-collection web-resource-nameRaw Pages/web-resource-name url-pattern/struts/*/url-pattern /web-resource-collection auth-constraint descriptionNo roles, so no direct access/description /auth-constraint /security-constraint On Thu, Jun 18, 2009 at 9:32 AM, abhishek reddy abhishek.c1...@gmail.com wrote: how to prevent users from directly accessing jsp files, rather they have to come thru sturts action? -- Abhishek
Re: drop down list not working after using validation.xml
After validation, Action's Preparable method is called, you can load the required list in request again. Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Samuel Goldwynhttp://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html - I'm willing to admit that I may not always be right, but I am never wrong. On Thu, Jun 18, 2009 at 5:08 PM, Dave Newton newton.d...@yahoo.com wrote: Please consider copying your code snippets into a plain-text editor before including them in an email message: we're getting a blank line between each line and a lot of spurious asterisks. Yanto wrote: *org.apache.jasper.JasperException: tag 'select', field 'list', name 'entityInternalId': The requested list key 'entities' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown location]* without validation xml and application page showing dropdown coming properly. s:select id=*entityInternalId* name=*entityInternalId* list=*entities* headerKey=** headerValue=** listKey=*internalId* listValue=*entityName* / Any one help on this ? Do you load the entities list? Recall that actions are instantiated per-request. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Load on startup servlet in glassfish initializing two times
It seems your problem something similar to : thishttp://markmail.org/message/24bkiar4ylo57lab#query:servlet%20init%20getting%20called%20twice+page:1+mid:fcrgp2ny3nnu3ia6+state:resultsand not struts related as Newton ( [?] Dave Newton) mentioned. Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Fran Lebowitzhttp://www.brainyquote.com/quotes/authors/f/fran_lebowitz.html - Life is something to do when you can't get to sleep. On Thu, Jun 18, 2009 at 5:09 PM, Dave Newton newton.d...@yahoo.com wrote: This doesn't appear to be a Struts issue. ECLIPSE + CVS wrote: I have one problem in glassfish while i am specifying the load on start up servlet; it is initializing two times. ie:Print statement in the init method of the servlet is executing two times. I need to look up all the ejb's while the server startup itself instead of waiting for a request to the server. My web.xml configuration is servlet servlet-nameBootStrap/servlet-name servlet-classcom.path.dcrms.login.BootStrap/servlet-class load-on-startup1/load-on-startup /servlet and my servlet is public class BootStrap extends HttpServlet{ public void init(ServletConfig config){ try { ELogger.log(Server is going to initialize all system prerequisites, DcrmsConstants.SEVERE); ELogger.log(Server is ready to process requests at+new Date(), DcrmsConstants.SEVERE); } catch (Exception ex) { ex.printStackTrace(); System.out.println(Boot Strap failed+ex); } } } I am using struts1.3.8+Hibernate with glass fish. If anybody has any idea plz help me.. Thanks in advance Crazy Worker. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: how to prevent users from directly accessing jsp files
yes it will not show the directory listing. but how now a user has to guess ur jsp name and its folder location which i think is difficult. And keeping the jsps inside WEB-INF will make the coder to add the WEB-INF before the page location. :( Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com George Carlinhttp://www.brainyquote.com/quotes/authors/g/george_carlin.html - Electricity is really just organized lightning. On Thu, Jun 18, 2009 at 8:45 PM, Jan T. Kim j@uea.ac.uk wrote: On Thu, Jun 18, 2009 at 07:47:45PM +0530, Girish Naik wrote: Go to Tomcat Home/conf/web.xml file. in this file put listings as false. init-param param-namelistings/param-name param-valuefalse/param-value /init-param Regards, - Girish Naik doesn't that still allow access by direct URL to the JSP? I think it disables directory listings only. Anyway, perhaps the easiest solution is to put such JSPs in a subdirectory of WEB-INF. The web container must not expose that hierarchy via HTTP (see servlet spec, section 9.5). I like to keep my JSPs in /WEB-INF/views . Best regards, Jan Mobile:-+91-09740091638 girish.n...@gmail.com Rodney Dangerfield http://www.brainyquote.com/quotes/authors/r/rodney_dangerfield.html - What a dog I got, his favorite bone is in my arm. On Thu, Jun 18, 2009 at 7:11 PM, Greg Lindholm greg.lindh...@gmail.com wrote: We put all our jsp file into a /struts/ folder then add the following security contraint to web.xml security-constraint display-namePrevent access to raw pages./display-name web-resource-collection web-resource-nameRaw Pages/web-resource-name url-pattern/struts/*/url-pattern /web-resource-collection auth-constraint descriptionNo roles, so no direct access/description /auth-constraint /security-constraint On Thu, Jun 18, 2009 at 9:32 AM, abhishek reddy abhishek.c1...@gmail.com wrote: how to prevent users from directly accessing jsp files, rather they have to come thru sturts action? -- Abhishek -- +- Jan T. Kim ---+ | email: j@uea.ac.uk | | WWW: http://www.cmp.uea.ac.uk/people/jtk | *-= hierarchical systems are for files, not for humans =-* - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: bean:message question
To open it as a link the url should be appended by 'http://' before ur url. So check if ur url from db always returns after 'http://' so that you can append 'http://' string at the start. Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Rodney Dangerfieldhttp://www.brainyquote.com/quotes/authors/r/rodney_dangerfield.html - What a dog I got, his favorite bone is in my arm. On Thu, Jun 18, 2009 at 11:41 PM, riya rachan...@gmail.com wrote: Hi, I have this requirement where I have to get the URL from database and plug this url in anchor from resource bundle. For eg: Database will give me: URL = www.google.com and the key in bundle: search_key = {0} Find it here Lets say n JSP % url = www.google.com ; -- This i'll get from database % bean:message bundle=AgrSales key=oss.test arg0=%= url/ But this does not work. Link that I get in UI opens http://localhost:8080/www.google.com. I even tried to return the content from java class only by using MessageFormat class. But it behaves in similar manner. Please help to get it done. Thanks for reading the post! -- View this message in context: http://www.nabble.com/%3Cbean%3Amessage%3E-question-tp24095363p24095363.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: how to prevent users from directly accessing jsp files
Hi, I tried putting the below string in web.xml, but all my css, js from the application got blocked. But pages are coming. Is something missing or some extra thing to be done? security-constraint display-namePrevent access to raw pages./display-name web-resource-collection web-resource-nameRaw Pages/web-resource-name url-pattern/struts/*/url-pattern /web-resource-collection auth-constraint descriptionNo roles, so no direct access/description /auth-constraint /security-constraint Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Fran Lebowitzhttp://www.brainyquote.com/quotes/authors/f/fran_lebowitz.html - Life is something to do when you can't get to sleep. On Thu, Jun 18, 2009 at 9:04 PM, Greg Lindholm greg.lindh...@gmail.comwrote: On Thu, Jun 18, 2009 at 11:25 AM, Girish Naik girish.n...@gmail.com wrote: yes it will not show the directory listing. but how now a user has to guess ur jsp name and its folder location which i think is difficult. And keeping the jsps inside WEB-INF will make the coder to add the WEB-INF before the page location. :( Everyone should know that obscurity is not security. Your users may not need to guess, the disgruntled programmer you fired last week will publish all your security weaknesses on an anonymous blog so everyone knows. At one point in time a few years ago you couldn't count on all web servers obeying the don't expose WEB-INF rule. Be sure you test your solution with the web server you will be using. Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com George Carlin http://www.brainyquote.com/quotes/authors/g/george_carlin.html - Electricity is really just organized lightning. On Thu, Jun 18, 2009 at 8:45 PM, Jan T. Kim j@uea.ac.uk wrote: On Thu, Jun 18, 2009 at 07:47:45PM +0530, Girish Naik wrote: Go to Tomcat Home/conf/web.xml file. in this file put listings as false. init-param param-namelistings/param-name param-valuefalse/param-value /init-param Regards, - Girish Naik doesn't that still allow access by direct URL to the JSP? I think it disables directory listings only. Anyway, perhaps the easiest solution is to put such JSPs in a subdirectory of WEB-INF. The web container must not expose that hierarchy via HTTP (see servlet spec, section 9.5). I like to keep my JSPs in /WEB-INF/views . Best regards, Jan
Re: STRUT2 s:property
Can a pre tag be useful?? pres:property//pre Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Samuel Goldwynhttp://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html - I'm willing to admit that I may not always be right, but I am never wrong. On Wed, Jun 17, 2009 at 10:40 PM, Jon Pearson jon.pear...@sixnet.comwrote: Perhaps what you want is a br /? -Original Message- From: cmoreno [mailto:cristina.moren...@gmail.com] Sent: Wednesday, June 17, 2009 1:02 PM To: user@struts.apache.org Subject: STRUT2 s:property Hi I have a problem with s:property tag. How can I use into this tag 's value special characters like \r\n. I tried with escape attribute, but it isn't work. I tried to change \r\n with br tag, but isn't work. If I look up into the source code the value is ok (with line return) How can I resolve this? Thank you -- View this message in context: http://www.nabble.com/STRUT2-%3Cs%3Aproperty%3E-tp24077856p240 77856.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Adding dynamic parameters to s:url
try adding *status=webP *in the s:iterator and use: s:param name=*#webP.name* value=*#webP.value* / Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com George Bernard Shawhttp://www.brainyquote.com/quotes/authors/g/george_bernard_shaw.html - A government that robs Peter to pay Paul can always depend on the support of Paul. On Tue, Jun 2, 2009 at 7:13 PM, Felipe Fraga felipefr...@gmail.com wrote: Greetings to all. I am trying to store dynamic parameters through requests. So, I have a class like this: public class WebParameter { private String name; private String value; } and in my Action class I have: private ListWebParameter webParameters; then I would like to do something like this in the JSP s:url id=theURL namespace=theNamespace action=theActionName s:iterator value=webParameters s:param name=%{name} value=%{value} / /s:iterator /s:url I can assure that webParameters is in the request scope, because I can iterate over it in a different place in the JSP and get the correct values. But inside s:url tab, no parameters are actually added. How can I achieve this? Thanks a lot, Felipe PS: All getters and setters are there in the code, but were ommited in this e-mail. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Adding dynamic parameters to s:url
May be, but i have successfully used 'status=' in my project. Anyways why not try both n use the one which works ;) Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Mark Twain http://www.brainyquote.com/quotes/authors/m/mark_twain.html - There is no sadder sight than a young pessimist. On Tue, Jun 2, 2009 at 7:30 PM, Wes Wannemacher w...@wantii.com wrote: On Tue, Jun 2, 2009 at 9:59 AM, Girish Naik girish.n...@gmail.com wrote: try adding *status=webP *in the s:iterator and use: s:param name=*#webP.name* value=*#webP.value* / I think it is 'var=' not 'status=' -Wes -- Wes Wannemacher Author - Struts 2 In Practice Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more http://www.manning.com/wannemacher - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Adding dynamic parameters to s:url
I had used it in the project, but since it was not working a colleague has changed it without my knowledge. Sorry to misguide as I thought it is working fine :( Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com George Bernard Shawhttp://www.brainyquote.com/quotes/authors/g/george_bernard_shaw.html - A government that robs Peter to pay Paul can always depend on the support of Paul. On Tue, Jun 2, 2009 at 7:51 PM, Dave Newton newton.d...@yahoo.com wrote: Girish Naik wrote: May be, but i have successfully used 'status=' in my project. Anyways why not try both n use the one which works ;) status is only the iterator status (with count, index, first, last, etc.) If it worked for you as the current iteration object then that's a very, very strange bug. If you could post code that uses the status attribute in this way we'd be interested in seeing what's broken. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: response.sendRedirect() with Struts2 within a portlet
I have used redirect in struts.xml file in two ways as : 1. result name=home type=redirecthome.action/result 2. result name=failure type=redirect-action param name=namespace//param param name=actionNamehome/param /result Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Groucho Marx http://www.brainyquote.com/quotes/authors/g/groucho_marx.html - A hospital bed is a parked taxi with the meter running. On Sun, May 31, 2009 at 1:50 PM, Crishantha Nanayakkara c.nanayakk...@gmail.com wrote: Hi, I have a requirement to use a response.sendRedirect() within my Action class. Basically this action class is used to manipulate a porltet. Unlike Struts1, we do not directly have any processAction() method and ActionRequest and ActionResponse objects to do a response.sendRedirect. I just want to know how do we get about executing the response.sendRedirect with Struts2? What should be the interface to implement within the action class to do this. (Just like ServletRequestAware to get the HttpServletRequest) Appriciate your help on this. Best Regards Crishantha -- View this message in context: http://www.nabble.com/response.sendRedirect%28%29-with-Struts2-within-a-portlet-tp23800916p23800916.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: How to make readonly textfield in Struts 2.0.11.2 datetimepicker
I have achieved this by use of JavaScript as follows: //2009-06-05T00:00:00 var validDate = /^([\d]{4})-([\d]{2})-([\d]{2})T([\d]{2})\:([\d]{2})\:([\d]{2})$/i; var elements = document.getElementsByName('dateOfBirth'); for(var i = 0; i elements.length; i++){ //alert('element:'+i +' element.value:'+ elements[i].value); if(!(validDate.test(elements[i].value))){ //here i am showing a error message, you can alert also. document.getElementById('registration_error_date_of_birth_required').style.display = ; isError = 1; } if(isError){ break; } } ... ... This function is called on submit of the form. But i would like to know if there is a way in Struts to control the user entry in the textbox. Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com W. C. Fields http://www.brainyquote.com/quotes/authors/w/w_c_fields.html - I am free of all prejudices. I hate every one equally. On Sat, May 30, 2009 at 11:28 AM, Girish Naik girish.n...@gmail.com wrote: There is no readonly attribute in s:datetimepicker tag. I am using the following tag s:datetimepicker id=registration_date_of_birth_field name=dateOfBirth labelposition=left type=date toggleDuration=2000 toggleType=fade disabled=true required=true displayFormat=-MM-dd'T'HH:mm:ss weekStartsOn=1 / PFA for the rendered UI for the above tag. Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Frank Lloyd Wrighthttp://www.brainyquote.com/quotes/authors/f/frank_lloyd_wright.html - TV is chewing gum for the eyes. On Fri, May 29, 2009 at 11:37 PM, Jim Collings jlistn...@gmail.comwrote: I just did this a while ago. All I had to do was set: readonly=true on the struts textfield tag. Mine doesn't have an icon though. On Fri, May 29, 2009 at 2:00 PM, Girish Naik girish.n...@gmail.com wrote: Hi, I have used struts2-core-2.0.11.2 in My Application. And intend to use the Struts date time picker, but the text field is coming as an editable field. I want to make it as a readonly textbox. The funny thing is that the dojo is not ready to pass my id to the textbox. Only name is supplied to the text box. Any suggesstions on how to make the textbox non editable and only the icon clickable? - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: response.sendRedirect() with Struts2 within a portlet
There is no documentation as such, but i read it in the book 'Struts 2 Design and Programming: A Tutorial' by Budi Kurniawan. This result is added to the action mapping in struts.xml file - e.g.: *action name=login class=com.something.webapp.action.LoginAction method=login result name=success type=redirecthome.action/result result name=sign_in type=tiles tiles:showLoginPage /result result name=home type=redirecthome.action/result result name=failure type=redirect-action param name=namespace//param param name=actionNamehome/param /result /action* Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Helen Rowlandhttp://www.brainyquote.com/quotes/authors/h/helen_rowland.html - One man's folly is another man's wife. On Sun, May 31, 2009 at 9:50 PM, Martin Gainty mgai...@hotmail.com wrote: Girish- can you provide the documentation which suggests Result and Result with params for redirect and redirect-action types? Thanks! Martin Gainty I would never join a club which would have me as a member - Groucho Marx __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Date: Sun, 31 May 2009 13:56:24 +0530 Subject: Re: response.sendRedirect() with Struts2 within a portlet From: girish.n...@gmail.com To: user@struts.apache.org I have used redirect in struts.xml file in two ways as : 1. result name=home type=redirecthome.action/result 2. result name=failure type=redirect-action param name=namespace//param param name=actionNamehome/param /result Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Groucho Marx http://www.brainyquote.com/quotes/authors/g/groucho_marx.html - A hospital bed is a parked taxi with the meter running. On Sun, May 31, 2009 at 1:50 PM, Crishantha Nanayakkara c.nanayakk...@gmail.com wrote: Hi, I have a requirement to use a response.sendRedirect() within my Action class. Basically this action class is used to manipulate a porltet. Unlike Struts1, we do not directly have any processAction() method and ActionRequest and ActionResponse objects to do a response.sendRedirect. I just want to know how do we get about executing the response.sendRedirect with Struts2? What should be the interface to implement within the action class to do this. (Just like ServletRequestAware to get the HttpServletRequest) Appriciate your help on this. Best Regards Crishantha -- View this message in context: http://www.nabble.com/response.sendRedirect%28%29-with-Struts2-within-a-portlet-tp23800916p23800916.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org _ Windows Live™: Keep your life in sync. http://windowslive.com/explore?ocid=TXT_TAGLM_BR_life_in_synch_052009
How to make readonly textfield in Struts 2.0.11.2 datetimepicker
Hi, I have used struts2-core-2.0.11.2 in My Application. And intend to use the Struts date time picker, but the text field is coming as an editable field. I want to make it as a readonly textbox. The funny thing is that the dojo is not ready to pass my id to the textbox. Only name is supplied to the text box. Any suggesstions on how to make the textbox non editable and only the icon clickable? Thanks in Advance. Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Mitch Hedberghttp://www.brainyquote.com/quotes/authors/m/mitch_hedberg.html - My fake plants died because I did not pretend to water them.
Re: How to make readonly textfield in Struts 2.0.11.2 datetimepicker
There is no readonly attribute in s:datetimepicker tag. I am using the following tag s:datetimepicker id=registration_date_of_birth_field name=dateOfBirth labelposition=left type=date toggleDuration=2000 toggleType=fade disabled=true required=true displayFormat=-MM-dd'T'HH:mm:ss weekStartsOn=1 / PFA for the rendered UI for the above tag. Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Frank Lloyd Wrighthttp://www.brainyquote.com/quotes/authors/f/frank_lloyd_wright.html - TV is chewing gum for the eyes. On Fri, May 29, 2009 at 11:37 PM, Jim Collings jlistn...@gmail.com wrote: I just did this a while ago. All I had to do was set: readonly=true on the struts textfield tag. Mine doesn't have an icon though. On Fri, May 29, 2009 at 2:00 PM, Girish Naik girish.n...@gmail.com wrote: Hi, I have used struts2-core-2.0.11.2 in My Application. And intend to use the Struts date time picker, but the text field is coming as an editable field. I want to make it as a readonly textbox. The funny thing is that the dojo is not ready to pass my id to the textbox. Only name is supplied to the text box. Any suggesstions on how to make the textbox non editable and only the icon clickable? - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org