Author Login
Post Reply
user Digest 16 Jul 2008 17:42:40 -0000 Issue 8145
Topics (messages 188983 through 189012):
Re: struts menu problem
188983 by: Jishnu Viswanath
188994 by: Alberto A. Flores
Re: 'include' struts.xml stuff is broken?
188984 by: Gabriel Belingueres
188986 by: Dave Newton
188997 by: Dave Belfer-Shevett
189001 by: Dave Newton
autocompleter bug in forefox3 but not in ie6
188985 by: Piotr Dzeviarylin
188987 by: Jishnu Viswanath
188996 by: Piotr Dzeviarylin
188998 by: Jishnu Viswanath
189000 by: Piotr Dzeviarylin
189002 by: Piotr Dzeviarylin
189003 by: Jeromy Evans
189012 by: Jishnu Viswanath
Re: Struts tags ID generation
188988 by: Dave Newton
188991 by: Phan Le
188992 by: Dave Newton
189011 by: Wes Wannemacher
Re: struts2 validation
188989 by: Pierrot52
Re: Problem with s:set and s:if
188990 by: Othon Reyes Sanchez
Re: ActionSupport.input()-- what's it for?
188993 by: Brad A Cupit
188995 by: Dave Newton
188999 by: Brad A Cupit
[OT] good logging
189004 by: Musachy Barroso
Can't access bean from jsp
189005 by: holod
189006 by: Lukasz Lenart
[S2] Jscalendar plugin does not work in S2.1.x
189007 by: Giovanni Azua
Re: /action/* - is it possible?
189008 by: Paul Benedict
189009 by: Becky.L.O'Sullivan.mhn.com
parameters from url
189010 by: piltrafeta
Administrivia:
---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)
----------------------------------------------------------------------

Attachment:
user_188983.ezm (zipped)Can you put the code some where, if you are using IE 6, it has a known
problem with z-index attribute.
Regards,
Jishnu Viswanath
Software Engineer
*(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll
Tavant Technologies Inc.,
www.tavant.com
PEOPLE :: PASSION :: EXCELLENCE
-----Original Message-----
From: Antonio Petrelli [mailto:antonio.petrelli@(protected)]
Sent: Wednesday, July 16, 2008 1:58 PM
To: Struts Users Mailing List
Subject: Re: struts menu problem
2008/7/14 nauke. <nauke0@(protected)>:
> Hi!
>
> I'm using struts version 2.0.11.
> I am using struts menu, which works provided it is not on top of a
table ...
> Please see screenshot of issue here:
> http://mytmpdir.googlepages.com/menu.jpg
>
> No idea how I can fix this!
> Does anyone?
Probably you have to ask the Struts menu maintainers:
http://struts-menu.sourceforge.net/mail-lists.html
Antonio
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)
Any comments or statements made in this email are not necessarily those of Tavant Technologies.
The information transmitted is intended only for the person or entity to which it is addressed and may
contain confidential and/or privileged material. If you have received this in error, please contact the
sender and delete the material from any computer. All e-mails sent from or to Tavant Technologies
may be subject to our monitoring procedures.

Attachment:
user_188994.ezm (zipped)This is clearly not a Struts2 question, but a Struts menu question (name
is misleading since it can be used outside the context of struts. I'm
using it like that).
A few thought:
- Have you checked the generated HTML code?
- Have you checked the generated CSS?
- If using velocity, have you check what the velocity macro used?
Consider enforcing you own CSS as this seems to me like a CSS/HTML code
problem, not a server side problem.
nauke. wrote:
> Hi,
>
> I don't suppose anyone knows why this issue is occurring ... ?
>
> Thanks
>
> On Mon, Jul 14, 2008 at 4:30 PM, nauke. <nauke0@(protected):
>
>> Hi!
>>
>> I'm using struts version 2.0.11.
>> I am using struts menu, which works provided it is not on top of a table
>> ...
>> Please see screenshot of issue here:
>> http://mytmpdir.googlepages.com/menu.jpg
>>
>> No idea how I can fix this!
>> Does anyone?
>>
>> Thanks guys
>>
>>
>>
>
--
Alberto A. Flores
http://www.linkedin.com/in/aflores

Attachment:
user_188984.ezm (zipped)In your struts-editevent.xml: http://pastebin.stonekeep.com/4956
<action> tags must be inside a <package>, and they are inside <struts>.
See the http://struts.apache.org/dtds/struts-2.0.dtd file
2008/7/16 Dave Belfer-Shevett <dbs@(protected)>:
> This seems like it should work, but I'm getting all sorts of hassles, and
> the documentation page for this, naturally, provides no examples of what the
> include file should look like.
>
> My struts.xml has...
>
> <!DOCTYPE struts PUBLIC
> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
> "http://struts.apache.org/dtds/struts-2.0.dtd">
> <struts>
> <include file="struts-editevent.xml">
> <package name="CONGO" extends="struts-default">
> <interceptors>
> [blah blah blah]
> </interceptors>
> (more actions)
> </package>
> </struts>
>
> The 'struts-editevent.xml' has:
> <action name="coconut/viewEditEvent" method="load"
> class="com.stonekeep.congo.coconut.EditEvent">
> <interceptor-ref name="mystack" />
> <result
> name="success">/WEB-INF/jsp/coconut/EditEventForm.jsp</result>
> <result name="login"
> type="redirect-action">coconut/showloginpage</result>
> </action>
>
> <action name="coconut/postEditEvent" method="update"
> class="com.stonekeep.congo.coconut.EditEvent">
> <interceptor-ref name="mystack" />
> <result
> name="success">/WEB-INF/jsp/coconut/Maintenance.jsp</result>
> <result
> name="input">/WEB-INF/jsp/coconut/EditEventForm.jsp</result>
> <result name="login"
> type="redirect-action">coconut/showloginpage</result>
> </action>
>
> A basic block of actions.
>
> I'm getting XML validatoin errors up the wazoo because the
> struts-editevent.xml file isn't well-formed. If I put it in <struts>
> blocks, I get "you're referencing interceptors that don't exist".
>
> If I try and duplicate the entire package, interceptors, and DTD definition
> into the include file, I get package collisions.
>
> My take is the <include> function does not work as described in the
> documentation. It should be a linear include, and the resulting document is
> parsed by SAX, but that doesn't seem to be happening.
>
> Can someone give me an example of an included XML file that actually works?
>
> Here are links to what I'm seeing:
> My main struts.xml: http://pastebin.stonekeep.com/4955
>
> My struts-editevent.xml: http://pastebin.stonekeep.com/4956
>
> What happens when I deploy:
>
> http://pastebin.stonekeep.com/4957
>
> Note that says "no grammar found". Adding the DTD says "you need a package
> name in your struts block" - etc etc etc. It never really resolves.
>
> Can someone show me an <include> setup that actually works?
>
> --
> -------------------.--------.-------------------------------.
> Dave Belfer-Shevett \ KB1FWR \ JID: dbs@(protected) \
> blog:planet-geek.com >--------'-----------------------------------.
> dbs@(protected) \
> -------------------< List; Please Wait For Next Error |
> \______________________________________________/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_188986.ezm (zipped)In addition to the other replies, I'll add my own.
--- On Tue, 7/15/08, Dave Belfer-Shevett <dbs@(protected):
> [...] the documentation page for this, naturally, provides
> no examples of what the include file should look like.
"Naturally?"
Sniping aside: the "include" documentation [1] states the following:
"Each included file must be in the same format as struts.xml, including the DOCTYPE. The include files can be placed anywhere on the classpath and should be referred to by that path by the "file" attribute."
To me that implies a well-formed, complete S2 config file.
> It should be a linear include, and the resulting document
> is parsed by SAX, but that doesn't seem to be happening.
I don't know if "should" is an appropriate word here. It may not meet your expectations, but it works as described, and in some ways is better than a linear include.
Dave
[1] "include" documentation:
http://struts.apache.org/2.x/docs/include-configuration.html

Attachment:
user_188997.ezm (zipped)On Wed, 16 Jul 2008, Dave Newton wrote:
> --- On Tue, 7/15/08, Dave Belfer-Shevett <dbs@(protected):
>> [...] the documentation page for this, naturally, provides
>> no examples of what the include file should look like.
>
> "Naturally?"
>
> Sniping aside: the "include" documentation [1] states the following:
>
> "Each included file must be in the same format as struts.xml, including the DOCTYPE. The include files can be placed anywhere on the classpath and should be referred to by that path by the "file" attribute."
>
> To me that implies a well-formed, complete S2 config file.
And was completely unmentioned in the document I was looking at:
http://struts.apache.org/2.x/docs/can-we-break-up-a-large-strutsxml-file-into-smaller-pieces.html
That FAQ should have had a link along the lines of "Full documentation for
include is [here...].
What neither document mentions is how to configure both the top level
struts.xml and the secondary files to avoid duplicating entire interceptor
stacks using packages. 1-2 lines referring to other bits of information
would have been enormously helpful.
I did finally get it working, using an <include> in struts.xml, and in the
included struts.xml, added dtd, a new package definition, and an
'extends=' reference to the parent package.
--
-------------------.--------.-------------------------------.
Dave Belfer-Shevett \ KB1FWR \ JID: dbs@(protected) \
blog:planet-geek.com >--------'-----------------------------------.
dbs@(protected) \
-------------------< List; Please Wait For Next Error |
\______________________________________________/

Attachment:
user_189001.ezm (zipped)--- On Wed, 7/16/08, Dave Belfer-Shevett <dbs@(protected):
> And was completely unmentioned in the document I was looking at:
Sorry we didn't put it where you looked. In general I usually recommend looking at core documentation in addition to FAQs, it provides context for the more free-form, supplementary nature of FAQs.
I've changed the FAQ entry [1] to point to the core documentation. (Note that changes are not immediately visible.)
> That FAQ should have had a link along the lines of
> "Full documentation for include is [here...].
Feel free to file a CLA and contribute to the documentation or file JIRA issues against existing documentation; input and contributions are helpful and appreciated (even more so without sniping and implied obligation :)
> What neither document mentions is how to configure both the
> top level struts.xml and the secondary files to avoid duplicating
> entire interceptor stacks using packages.
You lost me there; once an element (interceptor, stack, whatever) is defined it's available to subsequent elements. The <package...> documentation [2] describes the use of the "extends" attribute and states:
"The extends attribute is optional and allows one package to inherit the configuration of one or more previous packages - including all interceptor, interceptor-stack, and action configurations."
Dave
[1] Breaking up config files FAQ entry:
http://struts.apache.org/2.x/docs/can-we-break-up-a-large-strutsxml-file-into-smaller-pieces.html
[2] <package...> documentation:
http://struts.apache.org/2.x/docs/package-configuration.html

Attachment:
user_188985.ezm (zipped)In the html form I have this tag:
<sx:autocompleter list="{'apple','banana','grape','pear'}" id="stnnzn" name="name" keyName="nameKey" />
It works fine but doesn't pass values to action <name> and <nameKey>
properties. I test it in ie6 and everything is alright.
Does anybody knows the problem?

Attachment:
user_188987.ezm (zipped)I am not sure... Struts in turn uses dojo for its Ajax (it was .4) there
are lot of issues with dojo and ff3. I am not sure because of this it's
failing.
Can you tell me what exactly it's the error, if you have firebug
installed, tell is there any request in red?
Regards,
Jishnu Viswanath
Software Engineer
*(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll
Tavant Technologies Inc.,
www.tavant.com
PEOPLE :: PASSION :: EXCELLENCE
-----Original Message-----
From: Piotr Dzeviarylin [mailto:peter@(protected)]
Sent: Wednesday, July 16, 2008 5:19 PM
To: Struts Users Mailing List
Subject: autocompleter bug in forefox3 but not in ie6
In the html form I have this tag:
<sx:autocompleter list="{'apple','banana','grape','pear'}" id="stnnzn"
name="name" keyName="nameKey" />
It works fine but doesn't pass values to action <name> and <nameKey>
properties. I test it in ie6 and everything is alright.
Does anybody knows the problem?
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)
Any comments or statements made in this email are not necessarily those of Tavant Technologies.
The information transmitted is intended only for the person or entity to which it is addressed and may
contain confidential and/or privileged material. If you have received this in error, please contact the
sender and delete the material from any computer. All e-mails sent from or to Tavant Technologies
may be subject to our monitoring procedures.

Attachment:
user_188996.ezm (zipped)Yes, dojo in firefox3 works with bugs. Only loading dojo libs
requires manually change some firefox defalt parameters and this a big
problem for deploying web project with dojo running on ff3.
I have firebug installed but it doesn't show any error.
autocompleter simply doesn't pass it's values in request after form
submitting and those params in action are null, but on the other hand fulfill its functionality
perfectly (autocomplete operations).
I also test autocompleter in opera 9.5 and the tag doesn't work
either.
The only browser that understand autocompleter is ie6.
> I am not sure... Struts in turn uses dojo for its Ajax (it was .4) there
> are lot of issues with dojo and ff3. I am not sure because of this it's
> failing.
> Can you tell me what exactly it's the error, if you have firebug
> installed, tell is there any request in red?
> Regards,
> Jishnu Viswanath
> Software Engineer
> *(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll
> Tavant Technologies Inc.,
> www.tavant.com
> PEOPLE :: PASSION :: EXCELLENCE
> -----Original Message-----
> From: Piotr Dzeviarylin [mailto:peter@(protected)]
> Sent: Wednesday, July 16, 2008 5:19 PM
> To: Struts Users Mailing List
> Subject: autocompleter bug in forefox3 but not in ie6
> In the html form I have this tag:
> <sx:autocompleter list="{'apple','banana','grape','pear'}" id="stnnzn"
> name="name" keyName="nameKey" />
> It works fine but doesn't pass values to action <name> and <nameKey>
> properties. I test it in ie6 and everything is alright.
> Does anybody knows the problem?

Attachment:
user_188998.ezm (zipped)Opera does not work with dojo, by the way try in safari can u see what
is the generated code, I am using dojo 1, so had re written almost all
the ftl's. Dojo uses a hidden field where we store the data. Check if it
has given the proper name in generated code.
Regards,
Jishnu Viswanath
Software Engineer
*(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll
Tavant Technologies Inc.,
www.tavant.com
PEOPLE :: PASSION :: EXCELLENCE
-----Original Message-----
From: Piotr Dzeviarylin [mailto:peter@(protected)]
Sent: Wednesday, July 16, 2008 6:15 PM
To: Struts Users Mailing List
Subject: Re[2]: autocompleter bug in forefox3 but not in ie6
Yes, dojo in firefox3 works with bugs. Only loading dojo libs
requires manually change some firefox defalt parameters and this a big
problem for deploying web project with dojo running on ff3.
I have firebug installed but it doesn't show any error.
autocompleter simply doesn't pass it's values in request after form
submitting and those params in action are null, but on the other hand
fulfill its functionality
perfectly (autocomplete operations).
I also test autocompleter in opera 9.5 and the tag doesn't work
either.
The only browser that understand autocompleter is ie6.
> I am not sure... Struts in turn uses dojo for its Ajax (it was .4)
there
> are lot of issues with dojo and ff3. I am not sure because of this
it's
> failing.
> Can you tell me what exactly it's the error, if you have firebug
> installed, tell is there any request in red?
> Regards,
> Jishnu Viswanath
> Software Engineer
> *(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll
> Tavant Technologies Inc.,
> www.tavant.com
> PEOPLE :: PASSION :: EXCELLENCE
> -----Original Message-----
> From: Piotr Dzeviarylin [mailto:peter@(protected)]
> Sent: Wednesday, July 16, 2008 5:19 PM
> To: Struts Users Mailing List
> Subject: autocompleter bug in forefox3 but not in ie6
> In the html form I have this tag:
> <sx:autocompleter list="{'apple','banana','grape','pear'}" id="stnnzn"
> name="name" keyName="nameKey" />
> It works fine but doesn't pass values to action <name> and <nameKey>
> properties. I test it in ie6 and everything is alright.
> Does anybody knows the problem?
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)
Any comments or statements made in this email are not necessarily those of Tavant Technologies.
The information transmitted is intended only for the person or entity to which it is addressed and may
contain confidential and/or privileged material. If you have received this in error, please contact the
sender and delete the material from any computer. All e-mails sent from or to Tavant Technologies
may be subject to our monitoring procedures.

Attachment:
user_189000.ezm (zipped)I've already check the generated code in firebug. Yes, hidden fields
are in place. Here is html code:
<select dojoType="struts:ComboBox" id="synnzn" name="name" keyName="nameKey" initialValue="grape" visibleDownArrow="true" onblur="validate(this);" >
<option value="apple">apple</option>
<option value="banana">banana</option>
<option value="grape" selected="selected">grape</option>
<option value="pear">pear</option>
</select>
And this is code form firebug:
<span class="dojoComboBoxOuter dj_gecko" _="whitespace and CR's between tags adds in FF" style="">
<input dojoattachpoint="comboBoxValue" value="" name="name" tabindex="-1" style="display: none;"/>
<input dojoattachpoint="comboBoxSelectionValue" value="" name="nameKey" tabindex="-1" style="display: none;"/>
<input class="dojoComboBox" type="text" dojoattachpoint="textInputNode" dojoattachevent="key:_handleKeyEvents; keyUp: onKeyUp; compositionEnd; onResize;" autocomplete="off" style=""/>
<img class="dojoComboBox" hspace="0" vspace="0" src="/translator/struts/dojo/src/widget/templates/images/combo_box_arrow.png" dojoattachevent="onMouseUp: handleArrowClick; onResize;" dojoattachpoint="downArrowNode" style="width: 14px; height: 14px;"/>
<span class="dojoComboBoxOptions" style="display: none; position: absolute;"/>
</span>
As you can see everything seems good.
> Opera does not work with dojo, by the way try in safari can u see what
> is the generated code, I am using dojo 1, so had re written almost all
> the ftl's. Dojo uses a hidden field where we store the data. Check if it
> has given the proper name in generated code.
> Regards,
> Jishnu Viswanath

Attachment:
user_189002.ezm (zipped)I Think I find the bug.
See here:
<input dojoattachpoint="comboBoxValue" value="" name="name" tabindex="-1" style="display: none;"/>
<input dojoattachpoint="comboBoxSelectionValue" value="" name="nameKey" tabindex="-1" style="display: none;"/>
We don't have <id> param here, only <name>. And FF I think use
getElementBuId() func, which return null if missed id param. IE in such
cases use <name> param instead of <id>.
But I still don't know how to fix problem.
Don't anyone face this challenge?

Attachment:
user_189003.ezm (zipped)Piotr Dzeviarylin wrote:
> I Think I find the bug.
> See here:
>
For the sake of completeness, does your form work in Firefox 2.x?

Attachment:
user_189012.ezm (zipped)I noticed that.... but I don't think id is a mandatory field... id is
give for users to do manipulation on the widget, other wise it would be
mandatory field.
Any way did you check what is the value sending to server? I mean the
HTTP header?
Regards,
Jishnu Viswanath
Software Engineer
*(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll
Tavant Technologies Inc.,
www.tavant.com
PEOPLE :: PASSION :: EXCELLENCE
-----Original Message-----
From: Piotr Dzeviarylin [mailto:peter@(protected)]
Sent: Wednesday, July 16, 2008 7:25 PM
To: Struts Users Mailing List
Subject: Re[5]: autocompleter bug in forefox3 but not in ie6
I Think I find the bug.
See here:
<input dojoattachpoint="comboBoxValue" value="" name="name"
tabindex="-1" style="display: none;"/>
<input dojoattachpoint="comboBoxSelectionValue" value="" name="nameKey"
tabindex="-1" style="display: none;"/>
We don't have <id> param here, only <name>. And FF I think use
getElementBuId() func, which return null if missed id param. IE in such
cases use <name> param instead of <id>.
But I still don't know how to fix problem.
Don't anyone face this challenge?
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)
Any comments or statements made in this email are not necessarily those of Tavant Technologies.
The information transmitted is intended only for the person or entity to which it is addressed and may
contain confidential and/or privileged material. If you have received this in error, please contact the
sender and delete the material from any computer. All e-mails sent from or to Tavant Technologies
may be subject to our monitoring procedures.

Attachment:
user_188988.ezm (zipped)--- On Wed, 7/16/08, Phan Le <phan.anh.le@(protected):
> What if I dont want to put Id at all and leave it blank?
Modify the theme/template, I suppose [1, 2]? Is there any particular reason you don't want it to have an id?
Dave
[1] http://struts.apache.org/2.x/docs/themes-and-templates.html
[2] http://struts.apache.org/2.x/docs/extending-themes.html

Attachment:
user_188991.ezm (zipped)Thanks Dave.
We want to have more control of when to throw in IDs and when NOT to
throw in IDs. Basically, what we want is in the struts tags, if we
specify id attribute, struts should render it, otherwise, dont put
auto-generated ones in. Excessive IDs are a lot harder to maintain,
and we have UI guys to take care of all of the look and feel, W3C
compliance, cross browser behaviors. We only provide IDs when we
absolutely need it.
We also have automated acceptance testings which sometimes found
difficulty working with Struts generated ids.
Anyone know which Java class or place in the source code that the IDs
are generated?
Cheers,
On 16/07/2008, at 10:13 PM, Dave Newton wrote:
> --- On Wed, 7/16/08, Phan Le <phan.anh.le@(protected):
>> What if I dont want to put Id at all and leave it blank?
>
> Modify the theme/template, I suppose [1, 2]? Is there any particular
> reason you don't want it to have an id?
>
> Dave
>
> [1] http://struts.apache.org/2.x/docs/themes-and-templates.html
> [2] http://struts.apache.org/2.x/docs/extending-themes.html
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>

Attachment:
user_188992.ezm (zipped)--- On Wed, 7/16/08, Phan Le <phan.anh.le@(protected):
> Anyone know which Java class or place in the source code
> that the IDs are generated?
It might be easier to modify the template(s) as I suggested earlier; extracting the existing templates and modifying/extending a theme is a simpler solution than creating a custom S2 build.
Dave

Attachment:
user_189011.ezm (zipped)I took a quick look at the templates, and found that there is id
generation logic in UIBean.java -
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/UIBean.java?view=markup
So, forcing an element to not have an ID might be a bit tough. I still
agree with Dave though, that creating a custom template is your best
choice, it will require some decent freemarker skills though.
-Wes
On Wed, Jul 16, 2008 at 8:39 AM, Dave Newton <newton.dave@(protected):
> --- On Wed, 7/16/08, Phan Le <phan.anh.le@(protected):
>> Anyone know which Java class or place in the source code
>> that the IDs are generated?
>
> It might be easier to modify the template(s) as I suggested earlier; extracting the existing templates and modifying/extending a theme is a simpler solution than creating a custom S2 build.
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
--
Wesley Wannemacher
President, Head Engineer/Consultant
WanTii, Inc.
http://www.wantii.com

Attachment:
user_188989.ezm (zipped)
Hi Nicole,
This is an action class that does validation of two parameters:
public class SignonAction extends ActionSupport {
private String username;
private String password;
@Override
public String execute() throws Exception {
Map session = null;
boolean authenticated = false;
try {
authenticated = Utils.authenticate(username,password);
} catch(Exception e) {
// Swallow the exception
}
if (authenticated) {
session = ActionContext.getContext().getSession();
User user = new User();
user.setLogin(username);
user.setEmail("set your email");
session.put("loggedIn", user);
return SUCCESS;
} else {
return ERROR;
}
}
@RequiredStringValidator(message="", key = "username.required")
@StringLengthFieldValidator(message = "", key =
"username.invalidLength", minLength = "6" , maxLength = "15")
@RegexFieldValidator(message = "", key = "prompt.invalidCharacters",
expression = "^[a-zA-Z0-9]+$")
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
@RequiredStringValidator(message="", key="password.required")
@StringLengthFieldValidator(message = "", key =
"password.invalidLength", minLength = "6" , maxLength = "15")
@RegexFieldValidator(message = "", key = "prompt.invalidCharacters",
expression = "^[a-zA-Z0-9]+$")
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
It uses annotation to validate.
Hope this will help.
Regards.
Pierre
Nicole Luneburg wrote:
>
> Hi all!
>
> Been looking all over the net but my validation simply isn't working :(
>
>
>
> I have a JSP page with a dropdown box in a form.
>
> I just want to make sure the value in the dropdown box is not empty.
>
> It currently looks like this:
>
>
>
> <s:form action=3D"myaction" method=3D"post" validate=3D"true">
>
> <s:actionerror />
>
> <s:fielderror />
>
>
>
> <s:select name=3D"fieldName"
>
> id=3D"fieldName"
>
> theme=3D"simple"
>
> size=3D"1"
>
> list=3D"fieldList"
>
> headerKey=3D""
>
> headerValue=3D"- - Please Select - -"/>
>
> <s:submit name=3D"Submit"/>
>
> </s:form>
>
>
>
> My setup is that I have an Action class, which uses a Form to set and get
> f= ield values from the JSP page.
>
> In Struts1 I was using the validate(...) method in the Form class.
>
> It seems none of the Struts2 validation examples on the net are working
> for= me.
>
> Or I'm not doing it right.
>
>
>
> Anyone any ideas how I can do this simply?
>
>
>
> Cheers!
>
> nic
>
>
> ________________________________
> The contents of this email are confidential and may be subject to legal or
> professional privilege and copyright. No representation is made that this
> email is free of viruses or other defects. If you have received this
> communication in error, you may not copy or distribute any part of it or
> otherwise disclose its contents to anyone. Please advise the sender of
> your incorrect receipt of this correspondence.
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_188990.ezm (zipped)thanks!!!. that solved my problem
On Sat, Jul 12, 2008 at 12:23 PM, Gabriel Belingueres <belingueres@(protected)>
wrote:
> Looking at the docs:
> http://struts.apache.org/2.1.2/docs/ognl.html
>
> there is no #page notation when using struts taglibs, since they all
> use OGNL syntax.
> If you need to access a page scoped object, you need to use the #attr
> notation.
>
> 2008/7/12 Othon Reyes Sanchez <othon.reyes@(protected)>:
> > #page is not an instance of a user class.
> > page is an implicit object of jsp like request, session, application,
> etc.
> >
> > i don't know what is happening if i use <s:set name="aver" scope="page"
> > value="one"></s:set>
> > to put the variable "aver" in the page object it works fine. i mean, i
> can
> > use EL to use this var i.e. ( ${pageScope.aver} ).
> >
> > I think that my problem is that i don't know is how Io refer to the
> variable
> > aver that "lives" in the page implicit object.
> > I suppose there should be a way to do this, and i'm supposing this
> because
> > JSTL lets you do it like the following code:
> >
> > <c:if test="${pageScope.aver=='one'} ">
> > </c:if>
> >
> > i know S2 and JSTL is not the same but i think that this funcionality is
> > basic and S2 should allow you, unless there is a reason to not put a
> > instance in the page implicit object, but that doesn't have any sense.
> why
> > does S2 works with request or session but not with page?.
> >
> > Did i made myself clear?.
> >
> > BTW thanks for your help Dave.
> >
> >
> >
> > On Fri, Jul 11, 2008 at 10:07 PM, Dave Newton <newton.dave@(protected)>
> wrote:
> >
> >> Is #page one of the stack context vars? I'd consider using #attr, unless
> >> you can confirm that it is (I always forget). Or just use #request.
> >>
> >> Dave
> >>
> >> --- On Fri, 7/11/08, Othon Reyes Sanchez <othon.reyes@(protected):
> >> > I have a problem with the following code:
> >> >
> >> > <s:set name="aver" scope="page"
> >> > value="one"></s:set
> >> > ...
> >> > <s:if test="#page.aver=='one'">
> >> > <%-- Some code goes here --%>
> >> > </s:if>
> >> >
> >> > I don't know what is happening but the code
> >> > conditionated by the if is not
> >> > executed.
> >> > If i use request instead of page in the s:set tag, and
> >> > obiosly in the s:if
> >> > tag, the code works fine.
> >> >
> >> > can somebody tell me what i'm doing wrong?
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@(protected)
> >> For additional commands, e-mail: user-help@(protected)
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_188993.ezm (zipped)Tuesday, July 15, 2008 4:52 PM, Dave Newton wrote:
> It's the default implementation of a method designed for form
> input; validation is skipped by default.
> When you have an action implementing Prepareable it's a
> convenience, before annotation-based configuration you'd
> configure two action mappings--the initial form display
> would use the input() method, submission would use execute().
Thanks for the quick response Dave!
So, before annotation-based configuration, you'd setup action chaining
to have it go from the input() method to the execute() method?
Has that style now been replaced with Validateable's validate() method
and the DefaultWorkflowInterceptor?
Even then, I guess I still don't understand why it is a method on
ActionSupport, if it was just a convention.
Brad Cupit
Louisiana State University - UIS

Attachment:
user_188995.ezm (zipped)Oops, meant to send this to the list.
> --- On Wed, 7/16/08, Brad A Cupit wrote:
> So, before annotation-based configuration, you'd setup
> action chaining to have it go from the input() method
> to the execute() method?
No, you'd go to form display via input(), and submit to
execute(). Conceptually, like this:
<action name="foo_input"
method="input">
<result>/WEB-INF/jsps/foo.jsp</result>
</action>
<action name="foo">
<result
name="input">/WEB-INF/jsps/foo.jsp</result>
<result>/WEB-INF/jsps/foo_success.jsp</result>
</action>
I guess you *could* do it like you're suggesting, but I
never did. Of course, I'm usually wrong :)
There are a few different ways to implement a pattern like
this--I don't know which ideas came first; someone with
more WW experience could probably provide better history.
> Has that style now been replaced with
Validateable's
> validate() method and the DefaultWorkflowInterceptor?
Um, not sure; I guess I never really thought of the two as
related before. In my short time with WW/S2 the input()
method always skipped validation, so it always seemed to me
that they worked together to implement the pattern shown
above--but I could have completely misunderstood, too.
> Even then, I guess I still don't understand why it
is a
> method on ActionSupport, if it was just a convention.
So we didn't have to write our own if it didn't do
anything particularly special. For example, if we were
doing action initialization via Prepareable the default
impl would be enough (for the above, possibly wrong,
pattern).
Dave

Attachment:
user_188999.ezm (zipped)> No, you'd go to form display via input(), and submit to
> execute().
Oh that makes perfect sense! Got it now.
> the input() method always skipped validation
That makes sense too. The input method is listed in struts-default.xml
as an excludeMethod for the validation interceptor.
>> Even then, I guess I still don't understand why it is a
>> method on ActionSupport, if it was just a convention.
> So we didn't have to write our own if it didn't do
> anything particularly special
Ah! Got it. I completely understand now.
Thank you very much for your enlightening response Dave!
Brad Cupit
Louisiana State University - UIS

Attachment:
user_189004.ezm (zipped)Every time I see this code in S2, it makes me laugh so I will share it
here (DefaultActionInvocation.java):
...
if (proxy == null) {
gripe = "Whoa! No ActionProxy instance found in current
ActionInvocation. This is bad ... very bad";
} else if (proxy.getConfig() == null) {
gripe = "Sheesh. Where'd that ActionProxy get to? I can't find
it in the current ActionInvocation!?";
}
...
musachy
--
"Hey you! Would you help me to carry the stone?" Pink Floyd

Attachment:
user_189005.ezm (zipped)My task is:
1. Action PrepareLawDraft has private field LawDraft lawDraft ; it has
public getter and setter.
This action fills LawDraft object fields.
2.On ActionSupport.SUCCESS I go to processlaw.jsp
On this jsp I want to output some fields of LawDraft and allow user to
modify
3.Then user presses button "save" and I store LawDraft instance.
Problem:
On the step# 2 I can't access object LawDraft. I get this error:
javax.servlet.ServletException:
freemarker/ext/servlet/HttpRequestParametersHashModel.<init>(Ljavax/servlet/http/HttpServletRequest;)V
On jsp use this code:
<s:form action="#" method="post">
<s:submit value="Сохранить" name="submit"/>
</s:form>
I even don't try to access to LawDraft, I've put away that code, just empty
STRUTS2 tags. What does it mean?
Please, help, Google doesn't give me any suggestions.
I use WebSphere Application Server 6.1
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_189006.ezm (zipped)> <s:form action="#" method="post">
action is not the action attribute for particular form, but it's the
name of the action in struts.xml, so you should put # in there.
Could you post the whole stack trace?
Regards
--
Lukasz
http://www.lenart.org.pl/

Attachment:
user_189007.ezm (zipped)hi,
I followed the instructions here:
http://code.google.com/p/struts2jscalendarplugin/wiki/FAQ
but the jscalendar does not render ... is there anything extra to do
when using with S2.1.x? is it confirmed to work/not work with that version?
TIA,
Giovanni

Attachment:
user_189008.ezm (zipped)I've done *.do or /do/* in S1.
Is it possible in S2 to map a URI fragment (not extension) to invoke the
action? Can someone show me an example how?
Paul

Attachment:
user_189009.ezm (zipped)It's possible - we're doing it:
(Struts.xml)
<constant name="struts.enable.SlashesInActionNames" value="true" />
...
<action name="web**" class="...">
...
</action>
We also noticed Struts accepts web.action or just web, so our URLs look
like this
http://ourdomain.com/web/path/to/an/xml/file <-- web action is invoked
-B
I've done *.do or /do/* in S1.
Is it possible in S2 to map a URI fragment (not extension) to invoke the
action? Can someone show me an example how?
Paul
---------------------------------------------------------------------
This message, together with any attachments, is
intended only for the use of the individual or entity
to which it is addressed. It may contain information
that is confidential and prohibited from disclosure.
If you are not the intended recipient, you are hereby
notified that any dissemination or copying of this
message or any attachment is strictly prohibited. If
you have received this message in error, please notify
the original sender immediately by telephone or by
return e-mail and delete this message, along with any
attachments, from your computer. Thank you.
---------------------------------------------------------------------

Attachment:
user_189010.ezm (zipped)
hello,
i have a jsp code like this:
<s:textfield name="myName" key="myKey" maxlength="12">
<s:param name="value" value="%{#parameters.myParameter}"/>
<s:param name="labelcolspan" value="%{1}" />
<s:param name="inputcolspan" value="%{1}" />
</s:textfield>
myParameter is passed by url.
If i execute this in tomcat(i've installed in my machine) there is no
problem, the application gets the parameter; but if i execute it in the
oracle application server i don't see the parameter in the text file...
Does anybody knows why?
Thanks in advance!
--
Sent from the Struts - User mailing list archive at Nabble.com.