On the server-side, use an expression validator to ensure the input
contains only valid characters.
On the client-side either:
- use ajax validation; or
- use a javascript function that listens for the keypress event and
rejects invalid keystrokes
As usual, the javascript keypress event on
Thanks Jeromy!
Yeah that helped a lot!
It seems that making a topic for all ajax operations a little more tedious
than the basic approaches you've suggested. Although, I'm going to try them
all out for the learning experience!
Thanks Again!
Jeromy Evans - Blue Sky Minds wrote:
Grish
If you don't intend to have your application's package extend the
package defined in your plugin (which doesn't scale to multiple
plugins), what's the benefit of having this be a plugin as opposed to
just a .jar file?
I hoped that the plugin architecture will help me with the configuration
Hi,
In the link provided below,it uses struts1+hibernate+spring.I have done tht
and trying to do the same application in struts2.So now i have a jsp page to
enter user details and to register and after clicking on submit button
entered values should be saved into database for which I have used
Hi,
Where and how do struts 2 param tags get evaluated and injected into the
parent tag? When my custom tag is being invoked, the
Component.getParameters() method is returning empty list. Is there some
configuration required to make this work?
cp:text name=* s:param name='user.name'
I managed to have it working, sources are below. By the way, I do not
understand why the selected values in the combos are not submited (I have to
use some input hidden in the form...) any tip?
Hope it helps.
@Musachy : thanks for the link but I have problems to use most of the 2.1
examples.
Hmm found already, if value is in 'value' attribute it goes lost, hmm.. maybe
cos it is treated as Object. Was fixed by putting the value in the param
tags body.
mteccles wrote:
Hi,
Where and how do struts 2 param tags get evaluated and injected into the
parent tag? When my custom tag
Thank you very much Jeromy ,
It works I used the java Scripts for this to validate in client side.
sanjeewa
-Original Message-
From: Jeromy Evans [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 27, 2008 1:44 PM
To: Struts Users Mailing List
Subject: Re: Restric the values in
Sanjeewa Saman wrote:
Thank you very much Jeromy ,
It works I used the java Scripts for this to validate in client side.
You're welcome. Depending on how important the data is and how public
the site is, also consider validating it on the server-side in case of
users without javascript
- the interceptor can detect that the request is ajax either by the
partitioning of your packages/URLs or by inspecting the http header;
How can you know it is an ajax request by inspecting the http header?
I looked in my request headers and I can´t know whether it is ajax or not.
Thanks.
Well my interceptor was working already with the request object so from there
I just got the request URL. All my AJAX operations have the word Ajax in
them. So I just check if there's an Ajax string in my request URL.
This is what I had in my code:
boolean ajaxOperation =
Well I tried all approaches but I had a small problem with the javascript
redirect approach: I perform an AJAX operation and my interceptor redirects
to a page which displays the error message and has an inline javascript to
redirect to the login page as suggested.
It works fine in firefox but
Hi,
Thanks.This solution worked but can u tell me a way where in I dont have to
use OGNL because I dont want dependancy on webworks for JSP's.
Vijay
LEONARD Julien (Consulting for ACCOR Hotels) wrote:
Try this :
s:textfield theme=xhtml label= key=categoryName
cssClass=fieldGreen
Pablo Vázquez Blázquez wrote:
- the interceptor can detect that the request is ajax either by the
partitioning of your packages/URLs or by inspecting the http header;
How can you know it is an ajax request by inspecting the http header?
I looked in my request headers and I can´t know whether
The UI of my application is divided in 3 parts, which looks almost similar
to the UI of Eclipse IDE. The user selects operation from 'div' sitting on
the left, then the *upper right div* shows a request *form* and the div
sitting below it shows the result.
I need to submit the form to two
Hi all,
Can password confirmation be validated using client side validators in
Struts 2 ...?
Thanks
Thaminda
It'll definitely be possible using pure Dojo but you'll have to explore
their mailing list and wiki for 0.4 notes.
I'd start by trying to include an alert(message) in the inline script,
or window.status=messages lines, to isolate what does and doesn't work.
Also turn on debugging using the
script type=text/javascript
!--
window.location.href = /newbie/login.action;
//--
/script
Just a quick thought. Try this but include an empty div in the body.
The undefined in IE may be because Dojo is inserting an empty string
into the DOM using innerHTML.
(Dojo extracts the
Hello Thaminda,
In strus 2 you can validate the forms using javascript. The good thing in
strus 2 is that you don't have to write
the code for validating the form.
Code is automatically generated pease check
http://www.roseindia.net/struts/struts2/struts-2-client-side-validation-exam
ple.shtml
Hi all,
Can someone tell me how to achieve client side validation in struts 2 with
custom validators
It seems that password conformation in client side is not possible with the
provided validators in struts 2.
If we are to write a new validator in struts 2, what are the steps that we
have
In JSP page:
%
String onClick = ...
%
s:submit theme=simple name=submit value=submit onclick=%= onClick
% /
If i try to display jsp page, I get messege: attribute onclick does not
accept any expressions
I don't know how to display content of variable onClick into attribute
onclick.
It is
This simply appears to make the click on the submit button perform an
unparameterised GET on the defined URL.
-Original Message-
From: Musachy Barroso [mailto:[EMAIL PROTECTED]
Sent: 26 February 2008 18:42
To: Struts Users Mailing List
Subject: Re: Submit, ajax, targets and action
Just
Hi all,
I have multiple web applications following the struts framework. I have
certain common components that are used in all these web applications. I
have kept the common components as a struts plugin in each web application's
WEB-INF/lib folder. My plugin is accessing a taglib in another
Hi,
I have been following these instructions:
http://cwiki.apache.org/confluence/display/S2WIKI/Creating+a+custom+Dojo+profile+for+Struts+2.0.x
- I have extracted static and template to /struts (/src/main/webapp/struts).
- I have modified struts.properties to set struts.serve.static=false.
- I
Hello,
Working on it for a while but couldn't find a solution. In my action I
need the following Map:
MapString, ListMyBean myList;
... where the class MyBean is something like:
class MyBean {
private Long id;
private String name;
// + appropriate getters/setters
}
What I'd like is
When will launch the next version of the framework? The latest version came
out in September.
Luiz Henrique Rossetti
Hello,
I just asked this a week or two ago... it's imminent but not 100% confirmed.
Seems it needs to be qualified before getting available as a GA.
The only alternative is building it by our own using Maven.
Maxx
-
To
Pablo Vázquez Blázquez wrote:
May I have 2 different action extensions in the same webapp? Where do
I indicate the extension for each action? Now, I have set constant
name=struts.action.extension value=do/ in my struts.xml file, so
.do is the extension for all actions.
Hi Pablo,
That's
On Wed, Feb 27, 2008 at 10:48 AM, VJ22 [EMAIL PROTECTED] wrote:
Hi,
Thanks.This solution worked but can u tell me a way where in I dont have to
use OGNL because I dont want dependancy on webworks for JSP's.
I think you can't.
WebWork ended few months ago, and went to be replaced by XWork as
May I have 2 different action extensions in the same webapp? Where do I
indicate the extension for each action? Now, I have set constant
name=struts.action.extension value=do/ in my struts.xml file, so
.do is the extension for all actions.
Thanks.
Jeromy Evans escribió:
Pablo Vázquez
Thank you everyone for your input. I will research a little further
to see how I am going to do this.
On Tue, Feb 26, 2008 at 5:17 PM, Randy Burgess [EMAIL PROTECTED] wrote:
From: Richard Sayre [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List user@struts.apache.org
Date: Tue, 26 Feb
Well... I think it's using s:url value attribute instead of action
one. Isn't it?
Pablo Vázquez Blázquez escribió:
Yes, yes, I know, but my doubt is:
When calling DoItNow.do or DoItNow.xhtml? Where in my config do I
say that DoItNow is having .xhtml extension or .do one? Because, in
s:url
Yes, yes, I know, but my doubt is:
When calling DoItNow.do or DoItNow.xhtml? Where in my config do I
say that DoItNow is having .xhtml extension or .do one? Because, in
s:url action=actionName you do not specify the extension.
Thanks.
Jeromy Evans escribió:
Pablo Vázquez Blázquez wrote:
Hi,
I figured it out. I used s:set/ for this. Thanks.
s:iterator value=model.list
s:set name=value
s:property /
/s:set
custom:tag attr=${value} /
/s:iterator
regards
Kropp, Henning schrieb:
Hi List,
I am new to struts2. I iterate over a list of strings.
--- Maxx [EMAIL PROTECTED] wrote:
VJ22 [EMAIL PROTECTED] wrote:
Thanks.This solution worked but can u tell me a way
where in I dont have to use OGNL because I dont
want dependancy on webworks for JSP's.
s:textfield key=.../
where the key attribute is both the name of the field and the key
--- bugs_ [EMAIL PROTECTED] wrote:
In JSP page:
%
String onClick = ...
%
s:submit theme=simple name=submit value=submit onclick=%= onClick
% /
If i try to display jsp page, I get messege: attribute onclick does not
accept any expressions
I don't know how to display content of variable
it seems my dropdown collections on my bean are not getting repopulated when
i use the validator interceptor. What is the best practice for
repopulating dropdowns? Where should this logic be placed?
Pablo Vázquez Blázquez wrote:
Well... I think it's using s:url value attribute instead of action
one. Isn't it?
Ah, I see what you mean. Yes, via s:url, or s:form action=a url, or
sx:submit href=a url (for ajax tags).
The tags include code to generate the URL to an action based on the
Thank you. But the showcase didn't help me.
I actually can do what is showed in the showcase.
I'm able to call an action from inside the tab, and to show the resulting
jsp inside the tab again.
What I cannot achieve is to display inside the tab the result of the other
actions I call from the jsp
I've forwarded this to the struts-user list; it's better to ask questions
there.
--- Thaminda Karunanayake [EMAIL PROTECTED] wrote:
From: Thaminda Karunanayake [EMAIL PROTECTED]
I'm using Struts 2 client side validation to validate a password
confirmation field.
But to do that I can't use any
At the moment few issues in JIRA which are being checked over and fixed,
once these are out of the way a build will be produced and tested.
I'm sure you would prefer a tested working release as opposed to a release
made on a date just because that's the day someone said it would happen ;).
On Sun, Feb 24, 2008 at 4:37 PM, Dave Newton [EMAIL PROTECTED] wrote:
[...] the error is this:
Error setting expression 'currentEvent.excludeRulesValues['dd']' with
value '[Ljava.lang.String;@1f09665'
which looks more like it's trying to set a single String with a String[].
And how
--- Maxx [EMAIL PROTECTED] wrote:
MapString, ListMyBean myList;
... where the class MyBean is something like:
class MyBean {
private Long id;
private String name;
// + appropriate getters/setters
}
What I'd like is setting each value back through some s:textfield /
using the
This is server side though so it may not be what you need. You will need
your own javascript for the client as it is not generated for this
validator.
Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications
From: Randy Burgess [EMAIL PROTECTED]
Reply-To: Struts Users
Hi,
By implementing Preparable,ModelDriven,ServletRequestAware interfaces,am
able to get the form details and sent those details to service
implementation layer from an action class.From service implementation i have
called dao.Since DAO is not injected any where in struts.xml,its throwing
Try using the Dozer library on Sourceforge ( http://dozer.sourceforge.net/ )
It's test worth and even if it lacks some complex-hierarchy features,
it's far advanced from BeanUtils (indeed, it uses BeanUtils for basic
operations).
Maxx
--- bugs_ [EMAIL PROTECTED] wrote:
In JSP page:
%
String onClick = ...
%
s:submit theme=simple name=submit value=submit onclick=%= onClick
% /
If i try to display jsp page, I get messege: attribute onclick does not
accept any expressions
I don't know how to display content of
You mean a form with a password field and a confirm password field and
validation that they match?
@FieldExpressionValidator(expression = confirmPwd.equals(pwd), message =
Passwords do not match.)
In this case I have 2 fields, one named pwd and one named confirmPwd. I put
this validation on the
In my freemarker templates I can use struts-tags but struts-dojo-tags like
sx.a are ignored. am I missing something?
I'm trying include/define the taglib library as
http://struts.apache.org/2.x/docs/freemarker.html too, but when I add
#assign
sx=JspTaglibs[struts-dojo-tags] I obtain this error:
Time ago I noticed that javascript were removed and not executed in the pages
linked by sx:div ...
Parameters executeScripts and separateScripts don't solve the problem. Any
idea?
--
View this message in context:
http://www.nabble.com/-S2.1-No-javascript-in-sx%3Adiv-tp15715737p15715737.html
--- John Menke [EMAIL PROTECTED] wrote:
it seems my dropdown collections on my bean are not getting
repopulated when i use the validator interceptor. What is the
best practice for repopulating dropdowns? Where should this
logic be placed?
It may depend on how you're populating the
Hi
I have an strange problem with struts validation. Everything is ok. I checked
it several times.
but java script created by struts are shown on top of my page, where I put
html:javascript formName=MyFormName/
any idea?
Thanks.
-
Looking
--- Anet [EMAIL PROTECTED] wrote:
I have an strange problem with struts validation. Everything is ok.
...
but java script created by struts are shown on top of my page, where I put
html:javascript formName=MyFormName/
Is it rendering the script... tag properly? Which version of S1 are you
Try this:
http://opensource.atlassian.com/confluence/oss/download/attachments/4942
/validating-input.pdf?version=3
Basically, all you need to do for custom or complex validation is to
have the action in question implement Validateable, and then have a
public void validate() method that makes
--- Allen, Daniel [EMAIL PROTECTED] wrote:
Basically, all you need to do for custom or complex validation is to
have the action in question implement Validateable, and then have a
public void validate() method that makes calls to
addActionError(String). Also check out the built-in validators
Back on this:
s:set name=testValue value=%{12} /
testValue = s:property value=#testValue / // print 1
s:set name=testValueName value=%{'testValue'} /
testValueName = s:property value=#testValueName / // print
testValue
// print nothing!!!
--- Maxx [EMAIL PROTECTED] wrote:
Back on this:
s:set name=testValue value=%{12} /
testValue = s:property value=#testValue / // print 1
s:set name=testValueName value=%{'testValue'} /
testValueName = s:property value=#testValueName / // print
testValue
Kropp, Henning wrote:
I figured it out. I used s:set/ for this. Thanks.
s:iterator value=model.list
s:set name=value
s:property /
/s:set
custom:tag attr=${value} / /s:iterator
That will only work if the value you're trying to pass is a string.
It might also
Hi Dave;
whats your mean about rendering tag property?
everything is ok. just validation doesn't work.
I use struts 1.1 .
Dave Newton [EMAIL PROTECTED] wrote:
--- Anet wrote:
I have an strange problem with struts validation. Everything is ok.
...
but java script created by struts
--- Anet [EMAIL PROTECTED] wrote:
whats your mean about rendering tag property?
It ate part of my text; I was asking if it renders a lt;script...gt; tag.
If not, you'd have to put it inside one--I just don't remember much about S1
any more.
everything is ok. just validation doesn't work.
I'm stuck with this error and have no idea what the problem is...
In my action class, I'm returning a String property called ruleType. I've
verified that it has a value of A.
In my jsp, I have:
s:if test=ruleType == 'A'
[EMAIL PROTECTED] file=arithmeticDetail.jsp %
/s:if
For some reason,
IIRC a single-character in single quotes will evaluate to a character, not a
string. Not entirely sure I get the exception without looking at the source.
s:if test='ruleType == A'
should work, though (switched punctuation).
Dave
--- Eric Martin [EMAIL PROTECTED] wrote:
I'm stuck with this
Thanks Dave, that seemed to do the trick. I have other places where I use the
same notation, but not with a single-character.
So, it looks like struts converts it to a Char if it's a single-character
and a string if it's multi-character?
newton.dave wrote:
IIRC a single-character in single
Eric Martin wrote:
So, it looks like struts converts it to a Char if it's a single-character
and a string if it's multi-character?
Yes, but it's OGNL that does that, not Struts.
http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/basicExpressions.html#constants
-Dale
Hello. Where can I find these files for Struts 1.3.8?
- Asad
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
DNewfield wrote:
Eric Martin wrote:
So, it looks like struts converts it to a Char if it's a single-character
and a string if it's multi-character?
Yes, but it's OGNL that does that, not Struts.
http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/basicExpressions.html#constants
Paranoid_Fabio wrote:
Thank you. But the showcase didn't help me.
I actually can do what is showed in the showcase.
I'm able to call an action from inside the tab, and to show the resulting
jsp inside the tab again.
What I cannot achieve is to display inside the tab the result of the other
Dale Newfield wrote:
Jeromy Evans wrote:
You're following the right approach.
If you don't intend to have your application's package extend the
package defined in your plugin (which doesn't scale to multiple
plugins), what's the benefit of having this be a plugin as opposed to
just a .jar
Dear all;
I use struts2 version. And I have a page list including value of textboxs
generated by struts tag or html tag.
I would like to validate numerics data when user input in each text field.
Its not one times submit form; I mean process validation will be checked when
user finished
Maxx wrote:
Back on this:
s:set name=testValue value=%{12} /
testValue = s:property value=#testValue / // print 1
s:set name=testValueName value=%{'testValue'} /
testValueName = s:property value=#testValueName / // print testValue
// print nothing!!!
Hi all,
I'm fairly new to freemarker, and just started using in in the context
of a struts2
component tag. I was noticing that it seems like you can do this
${foo.bar}
anywhere in the template (vs. using the s.property tag), *but* only when
the top object on the value stack is the object
Hello friends -
I feel like I must be missing something simple, but can't see it for the life
of me.
Struts 1.3.8
I have an array of objects on my form that I need to submit values against.
So, I have a top level loop something like this:
logic:iterate name=myFormName
Hi,
Me posting my second newbie question.
I have an action that retrieves a record (let's call it GetBlahAction) and
render info onto the screen you see. I also have an action which renders a
menu on the left hand side of the screen depending on user permission(let's
call this one MenuAction).
I tried what you suggested, I placed an empty div but I got the same result,
still undefined with IE. I looked at the debug output and it parses the
proper javascript code just that it doesn't execute. The debug output is
practically the same between firefox and IE.
I'll try reserching in the
Asad Habib wrote:
Hello. Where can I find these files for Struts 1.3.8?
They're packaged inside the struts.jar file.
L.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
StrutsNewbie wrote:
Hi all,
I have multiple web applications following the struts framework. I have
certain common components that are used in all these web applications. I
have kept the common components as a struts plugin in each web
application's WEB-INF/lib folder. My plugin is
Hi,
By implementing Preparable,ModelDriven,ServletRequestAware interfaces,am
able to get the form details and sent those details to service
implementation layer from an action class.From service implementation i have
called dao.Since DAO is not injected any where in struts.xml,its throwing
Why do you need an action to create a menu?
Is there any reason you can't use a combination of something like SiteMesh
(http://www.opensymphony.com/sitemesh/) and struts-menu
(http://struts-menu.sourceforge.net/) to create a menu which is
automatically added to your pages?
- Original
78 matches
Mail list logo