how to make a control button on jsp page in struts2

2007-11-15 Thread yogesh_mbm
hi, I want to make a button on jsp page using struts2 but i didn't get any way to make it ,if i use html tag input type=button then validator framework does not support . so please reply me asap -- View this message in context:

Re: [s2] How can I access the RequestMap from an Interceptor?

2007-11-15 Thread Thilo Ettelt
I'm sorry I didn't make it clear enough. I do not want to access the parameters. I would like to access all attributes of a request (i.e. remote host, request uri, headers, etc) and I thought Struts2 would wrap that up in a servlet independent map so I don't have to depend on Servlet specific

Getting an erro like Exception starting filter struts2

2007-11-15 Thread vijay vijay
Hi i am new to this struts 2.i am getting an error like fallowing can any one help me why i am getting like this. 15/11/2007 12:51:47 ã org.apache.catalina.core.StandardContext filterStart SEVERE: Exception starting filter struts2 Unable to load bean: type:

s:url action and method separator using something other than action!method

2007-11-15 Thread Amit Rana
Hi, I have a url for login s:url id=loginurlid namespace=/ action=login method=input/s:url This generates a url like http://localhost:8080/myapp/login!input.action Is there a way to tell s:url to use _ or / as separator and not ! Thanks, Amit.

Re: Getting an erro like Exception starting filter struts2

2007-11-15 Thread joey
check whether the xwork2.jar exists in your classpath On Nov 15, 2007 5:16 PM, vijay vijay [EMAIL PROTECTED] wrote: Hi i am new to this struts 2.i am getting an error like fallowing can any one help me why i am getting like this. 15/11/2007 12:51:47 ã

Re: Getting an erro like Exception starting filter struts2

2007-11-15 Thread vijay vijay
HI ACTALLY i am using tomacat 6.0 ,it is working for tomcat 5.5 i have not used any class path here On 11/15/07, joey [EMAIL PROTECTED] wrote: check whether the xwork2.jar exists in your classpath On Nov 15, 2007 5:16 PM, vijay vijay [EMAIL PROTECTED] wrote: Hi i am new to

getText returning message key

2007-11-15 Thread Dean Pullen
Hi all, Having a perculiar problem regarding getText() in an action. It seems to be returning the key, not its value, even though the key exists. (Which is odd, as the javadocs say getText returns null if key not found). The action is a login action, not sure if that makes any

Re: Getting an erro like Exception starting filter struts2

2007-11-15 Thread Jeromy Evans
SEVERE: Exception starting filter struts2 is most commonly caused by a classpath error - usually there's something missing from the lib directory of your webapp. In your case, the root cause is name xwork has already been loaded by bean, which probably means you have two different versions of

Re: How to preselect a radio button in Struts 2

2007-11-15 Thread Randy Burgess
Here is a working example. s:radio list=#{1:'Yes', 2:'No'} value=${u.access_lvl_types_id} name=users(${u_rowNum}).access_lvl_types_id/ The value coming from the bean is always 1 or 2. HTH Regards, Randy Burgess Web Applications Developer Nuvox Communications From: Pankaj Gupta [EMAIL

Re: [s2] How can I access the RequestMap from an Interceptor?

2007-11-15 Thread Gary Affonso
Thilo Ettelt wrote: I'm sorry I didn't make it clear enough. I do not want to access the parameters. I would like to access all attributes of a request (i.e. remote host, request uri, headers, etc) and I thought Struts2 would wrap that up in a servlet independent map so I don't have to depend

RE: S2: Struts way of submitting a value on change?

2007-11-15 Thread Hernandez, David
Version 2.1 will supposedly have this feature set. -Original Message- From: James Carr [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 14, 2007 8:33 PM To: Struts Users Mailing List Subject: S2: Struts way of submitting a value on change? Hi All, What is the struts 2 way of using

access to bean property in struts2

2007-11-15 Thread slideharmony
Hello, how can I access a bean properties from a jsp page? I have created an action to creare a new account for a generic user, and I want to print in a jsp page the full name of the new user. Usually I put the new User object in session and obtained his properties by this way form the jsp page,

Re: access to bean property in struts2

2007-11-15 Thread Dave Newton
In your action: public User getUser() { return this.user; } In your JSP: s:property value=user.fullName/ Through a request wrapper you can also use JSP 2.0 EL if you're running a JSP 2 container: ${user.fullName} if you don't mind mixing paradigms. d. --- slideharmony [EMAIL PROTECTED]

RE: access to bean property in struts2

2007-11-15 Thread Hernandez, David
Set the Bean as a member of the Action class and use: s:property value=beanVarName.beanMemberName / -Original Message- From: slideharmony [mailto:[EMAIL PROTECTED] Sent: Thursday, November 15, 2007 11:28 AM To: user@struts.apache.org Subject: access to bean property in struts2 Hello,

Re: [struts] JAAS and Struts Re-authentication Question

2007-11-15 Thread Dale Newfield
Laurie Harper wrote: If you have a separate 'login' page (as opposed to having a login form on each page) you might be able to get away with invalidating the session when that page is shown, with the caveat that logged in users would implicitly be logged out if they visit that page. And in

Each list value is a hyper link action in optiontransferselectTag?

2007-11-15 Thread Emi Lu
Greetings, Is it possible that each line value in optiontransferselectTag is a hyperlink action. for example, all emp selected emp emp1 emp6 emp2 emp7 Employee rec emp3 emp4 emp5

Re: struts2: some action mapping clarificacions needed

2007-11-15 Thread Omkar patil
Read through the javadocs for DefaultActionMapper. hernan gonzalez wrote: I have a wildcard mapping, say action name=CarCRUD_* method={1} class=myCarCRUAction If I have a form s:form action=CarCRUD_load... which results in (html stripped) form action=/Presentation/test/CarCRUD_load.do2 and

Re: Struts Validator to Prevent SQL Injection Attacks

2007-11-15 Thread Dave Newton
--- Mike Duffy [EMAIL PROTECTED] wrote: Does anyone have a great solution for a validator that will prevent users from entering malicious SQL into form entry text fields? I'm not sure that belongs in a validator; unless you never need to allow the use of a single quote. It is, hoever unlikely,

Re: [struts] s:url action and method separator using something other than action!method

2007-11-15 Thread Dale Newfield
Amit Rana wrote: I have a url for login s:url id=loginurlid namespace=/ action=login method=input/s:url This generates a url like http://localhost:8080/myapp/login!input.action Is there a way to tell s:url to use _ or / as separator and not ! In struts.xml you can define any name you

Re: [struts] JAAS and Struts Re-authentication Question

2007-11-15 Thread Adam Gordon
I believe you are absolutely correct Laurie, because I've not yet seen a way to get a handle to the LoginContext to call logout(). All we can do is invalidate the session - which we do when the user logs out. This removes the user principal from the request and indicates to JAAS that the

Re: s:url action and method separator using something other than action!method

2007-11-15 Thread Omkar patil
Amit, I am not sure if there is any easy way to achieve this. Is there any specific reason you would like achieve this? One way could be provide your own action mapper class by extending DefaultActionMapper and overriding getUriFromActionMapping method to provide your own separator. -Omkar

Form Submission Question

2007-11-15 Thread Hernandez, David
Can anyone point me to a location that outlines the Form submission/processing flow for struts 2? I'm having a bit of a problem deciphering how forms are supposed to be handled. For instance I have a Bean (Building) that I want to update (to a DB) from a form: JSP: s:form action=setBuilding

Re: [struts] JAAS and Struts Re-authentication Question

2007-11-15 Thread Adam Gordon
See my comments in my response to Laurie. We're basically using dual login pages, one on our main website (Apache) and the other in our webapp. I'm currently toying with the idea of a Filter to detect the subsequent logins against an already authenticated session. --adam Dale Newfield

Struts Validator to Prevent SQL Injection Attacks

2007-11-15 Thread Mike Duffy
Does anyone have a great solution for a validator that will prevent users from entering malicious SQL into form entry text fields? Thx. Mike Get easy, one-click access to your favorites. Make Yahoo!

Re: [struts] JAAS and Struts Re-authentication Question

2007-11-15 Thread Dale Newfield
Adam Gordon wrote: For background, we actually have two login pages: on is the login page that is running inside our webapp that is running JAAS and POSTs to j_security_check at form submission time. The other page is our company's main website (Apache) and users can log in here too. What

Re: Form Submission Question

2007-11-15 Thread Dave Newton
--- Gary Affonso [EMAIL PROTECTED] wrote: Dave Newton wrote: The action that *processes* the form submission may extend ActionSupport. Dave knows that, of course, but I didn't want the emphasis on *processes* above to make you think ActionSupport was only appropriate for form

Re: Struts Validator to Prevent SQL Injection Attacks

2007-11-15 Thread Martin Gainty
Mike- There are actually 2 situations to be mindful of (Not a salesman for these folks but acutenix had a very good tutorial) SQLInjection Solution might use a JS Validator.. but just in case JS validator passes it on the Server side to look for AND /OR funky conditional 1=1 comes to mind and

RE: Form Submission Question

2007-11-15 Thread Hernandez, David
Thanks guys. The bootstrap should have an example where the fields are populated by the Action Class's member variables. But I figured it out, I think . . . -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Thursday, November 15, 2007 2:20 PM To: Struts Users Mailing

Re: Struts Validator to Prevent SQL Injection Attacks

2007-11-15 Thread Mike Duffy
Antonio, Prepared statements if created correctly will work, but if your statements are created dynamically with text strings as the values instead of ? placeholders problems can occur. See the link from Gary Affonso's post:

Re: Form Submission Question

2007-11-15 Thread Gary Affonso
Dave Newton wrote: The action that *processes* the form submission may extend ActionSupport. Yup. Note that it's commonly not just form processing actions that extend ActionSupport, it's often all actions. Dave knows that, of course, but I didn't want the emphasis on *processes* above to

Re: Struts Validator to Prevent SQL Injection Attacks

2007-11-15 Thread Gary Affonso
Dave Newton wrote: --- Mike Duffy [EMAIL PROTECTED] wrote: Does anyone have a great solution for a validator that will prevent users from entering malicious SQL into form entry text fields? I'm not sure that belongs in a validator; unless you never need to allow the use of a single quote. It

Re: Struts Validator to Prevent SQL Injection Attacks

2007-11-15 Thread Mike Duffy
No matter where this is done, the basic problem is we have single quotes, double quotes, ampersands, semicolons, and parenthesis in our data. After Googleing on this topic for an hour or so I do not see an elegant solution, other than possibly filtering on SQL key words (DROP, ALTER, etc.).

Re: Form Submission Question

2007-11-15 Thread Dave Newton
The action that *processes* the form submission may extend ActionSupport. You submit the form to an action. The action either contains the fields of the form or contains a bean that can be used on the form. The bootstrap tutorial goes through a simple form processing example.

Re: Struts Validator to Prevent SQL Injection Attacks

2007-11-15 Thread Roberto Nunnari
Hi Mike. my comments below. Mike Duffy wrote: Thx Gary. That is good information. We are actually using JBoss with EJB 3.0, which uses Hibernate under the covers, so I am assuming we are covered. Not that sure.. if your DAO uses SQL strings in the queries (Hibernate lets you do that),

Re: Struts Validator to Prevent SQL Injection Attacks

2007-11-15 Thread Antonio Petrelli
2007/11/15, Mike Duffy [EMAIL PROTECTED]: No matter where this is done, the basic problem is we have single quotes, double quotes, ampersands, semicolons, and parenthesis in our data. This may be off topic, but does not is suffice to use prepared statement and parameters to avoid such attacks?

Re: Struts Validator to Prevent SQL Injection Attacks

2007-11-15 Thread Antonio Petrelli
2007/11/15, Mike Duffy [EMAIL PROTECTED]: Prepared statements if created correctly will work, but if your statements are created dynamically with text strings as the values instead of ? placeholders problems can occur. I wonder why do you create query strings this way: you can always create

Re: Struts Validator to Prevent SQL Injection Attacks

2007-11-15 Thread Mike Duffy
Thx Gary. That is good information. We are actually using JBoss with EJB 3.0, which uses Hibernate under the covers, so I am assuming we are covered. Mike --- On Thu, 11/15/07, Gary Affonso [EMAIL PROTECTED] wrote: From: Gary Affonso [EMAIL PROTECTED] Subject: Re: Struts Validator to

Re: Struts Validator to Prevent SQL Injection Attacks

2007-11-15 Thread Antonio Petrelli
Whoops sorry Mike, I misread your post, and I did not notice that you was confirming what I wrote before. Sorry Antonio 2007/11/15, Mike Duffy [EMAIL PROTECTED]: Antonio, Prepared statements if created correctly will work, but if your statements are created dynamically with text strings as

RE: Form Submission Question

2007-11-15 Thread Hernandez, David
I'm having a problem with my bean going out of scope. The form is populated with the bean information fine, but when I submit building is null? How do I keep it in scope? Do I have to pull it back out of the ActionContext? public class BuildingFormTestAction extends ActionSupport {

RE: Form Submission Question

2007-11-15 Thread Dave Newton
Or you can put the city.id in the form as a hidden field. d. --- Hernandez, David [EMAIL PROTECTED] wrote: Sorry, The problem was that building has a member variable that is a class (City) which is going out of scope. Building.toString() calls city.getId() throwing the exception and

RE: Form Submission Question

2007-11-15 Thread Hernandez, David
Sorry, The problem was that building has a member variable that is a class (City) which is going out of scope. Building.toString() calls city.getId() throwing the exception and returning null . . . Now, to keep that in scope somehow . . . -Original Message- From: Hernandez, David Sent:

Basic Struts work flow question

2007-11-15 Thread Minghui Yu
Hi there, I am new to Struts (version 1.2.7). I am developing a small app to learn Struts. Could you please give me some suggestions? Many thanks!! Scenario: A very small web app. I have 3 tables: student, course, and student- course. Student and course are 1:N relationship. student-course is a

Re: Basic Struts work flow question

2007-11-15 Thread Gary Affonso
Minghui Yu wrote: Hi there, I am new to Struts (version 1.2.7). I am developing a small app to learn Struts. Could you please give me some suggestions? Respectfully, my first suggestion would be to use Struts 2. If you're just getting started and you need to climb a learning-curve anyway,

RE: Basic Struts work flow question

2007-11-15 Thread Givler, Eric
Responses inline... -Original Message- From: Minghui Yu [mailto:[EMAIL PROTECTED] Sent: Thu 11/15/2007 7:16 PM To: Struts Users Mailing List Cc: Subject: Basic Struts work flow question Hi there,

help - pagination using struts2

2007-11-15 Thread DharmaRao.Edula
HI I am not able to find out pagination using Struts2. Is there any tag lib ( which is similar to struts layout in Struts 1.x) available in Struts2. Could any one guide me or send me some sample code. thanks and regards DharmaRao This e-mail and any files transmitted with it are for the

[S2] wildcard mapping and spring

2007-11-15 Thread Laszlo Borsos
I started using Spring 2 with Struts 2. I can't use wildcard mappings though. This works: action name=login class=loginAction This does not: action name=* class={1}Action Is there any way around this? kuvera - http://javatar.hu Java EE programming -- View this message in context:

Re: conditional matching using s:if

2007-11-15 Thread SudarshanP
Thanks for the help Could get what i wanted by using the s:set tag. Code snippet below -- s:iterator value=allBranches status=stat div style=display:nones:set name=brnames:property//s:set/div s:if test=%{#brname=='START'} table class=gridTable id='s:property/'tr