Re: JBoss 5 RC1 and Struts 2 : Simple validation error (URI scheme is not file)

2008-09-09 Thread Don Brown
Sorry, I was thinking of another JBoss issue with the tld file, not
the validators file.

Don

On Tue, Sep 9, 2008 at 3:31 PM, Bobby Mitch [EMAIL PROTECTED] wrote:
 hi,
 where do you suggest that i modify the order of the elements ?
 I checked the library struts2-core-2.1.2.jar, there is a struts-2.0.tld 
 descriptor tagfile inside of it but there is not much inside of it.

 Or maybe i should use a different version of Struts 2 ? Some other library ?
 Thanks for helping.

 --- On Sun, 9/7/08, Don Brown [EMAIL PROTECTED] wrote:
 From: Don Brown [EMAIL PROTECTED]
 Subject: Re: JBoss 5 RC1 and Struts 2 : Simple validation error (URI scheme 
 is not file)
 To: Struts Users Mailing List user@struts.apache.org
 Date: Sunday, September 7, 2008, 10:53 PM

 There was a JBoss issue that I found once I added JBoss 4.2 testing
 with the tld.  Not sure if that fix is in 2.1.2, but it will be in
 2.1.3.  If you need, you can just unzip the Struts jar, fix the order
 of the elements that is causing the problem, and zip it back up.

 Don

 On Mon, Sep 8, 2008 at 3:38 PM, Jeromy Evans
 [EMAIL PROTECTED] wrote:
 Bobby Mitch wrote:

 Well,
 I upgraded to the beta version and I am getting errors in the
 struts-tags.tld file that i extracted from struts2-core-2.1.2.tld and
 put
 under WEB-INF/


 Upgrading to 2.1.2 is a major effort, so I don't recommend that (too
 late...).  You'll have to read the release notes and migration guide
 on the
 download page.
 Downgrading to 2.0.11.1 sounds reasonable if there's an actual
 explanation
 for it.

 I'm not familiar with the exception but I recommend one of these
 approaches:
 - change the DOCTYPE to reference a SYSTEM URI.  It appears to not like
 that
 there's a URI using http. Perhaps change it to FILE and point to a
 local
 copy.
 - create an XML catalog file so the URI's are all registered on the
 local
 machine (so it doesn't have to validate using an external file).
 Here's the tutorial I follow:
 http://www.sagehill.net/docbookxsl/WriteCatalog.html
 (it relates to DocBook XML but the principle applies)

 Hope that helps.
 Jeromy Evans

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JBoss 5 RC1 and Struts 2 : Simple validation error (URI scheme is not file)

2008-09-09 Thread Bobby Mitch
Any other suggestion, anyone ?
Thanks for helping.

--- On Tue, 9/9/08, Don Brown [EMAIL PROTECTED] wrote:
From: Don Brown [EMAIL PROTECTED]
Subject: Re: JBoss 5 RC1 and Struts 2 : Simple validation error (URI scheme is 
not file)
To: Struts Users Mailing List user@struts.apache.org, [EMAIL PROTECTED]
Date: Tuesday, September 9, 2008, 12:27 AM

Sorry, I was thinking of another JBoss issue with the tld file, not
the validators file.

Don

On Tue, Sep 9, 2008 at 3:31 PM, Bobby Mitch [EMAIL PROTECTED] wrote:
 hi,
 where do you suggest that i modify the order of the elements ?
 I checked the library struts2-core-2.1.2.jar, there is a struts-2.0.tld
descriptor tagfile inside of it but there is not much inside of it.

 Or maybe i should use a different version of Struts 2 ? Some other library
?
 Thanks for helping.

 --- On Sun, 9/7/08, Don Brown [EMAIL PROTECTED] wrote:
 From: Don Brown [EMAIL PROTECTED]
 Subject: Re: JBoss 5 RC1 and Struts 2 : Simple validation error (URI
scheme is not file)
 To: Struts Users Mailing List user@struts.apache.org
 Date: Sunday, September 7, 2008, 10:53 PM

 There was a JBoss issue that I found once I added JBoss 4.2 testing
 with the tld.  Not sure if that fix is in 2.1.2, but it will be in
 2.1.3.  If you need, you can just unzip the Struts jar, fix the order
 of the elements that is causing the problem, and zip it back up.

 Don

 On Mon, Sep 8, 2008 at 3:38 PM, Jeromy Evans
 [EMAIL PROTECTED] wrote:
 Bobby Mitch wrote:

 Well,
 I upgraded to the beta version and I am getting errors in the
 struts-tags.tld file that i extracted from struts2-core-2.1.2.tld
and
 put
 under WEB-INF/


 Upgrading to 2.1.2 is a major effort, so I don't recommend that
(too
 late...).  You'll have to read the release notes and migration
guide
 on the
 download page.
 Downgrading to 2.0.11.1 sounds reasonable if there's an actual
 explanation
 for it.

 I'm not familiar with the exception but I recommend one of these
 approaches:
 - change the DOCTYPE to reference a SYSTEM URI.  It appears to not
like
 that
 there's a URI using http. Perhaps change it to FILE and point to a
 local
 copy.
 - create an XML catalog file so the URI's are all registered on
the
 local
 machine (so it doesn't have to validate using an external file).
 Here's the tutorial I follow:
 http://www.sagehill.net/docbookxsl/WriteCatalog.html
 (it relates to DocBook XML but the principle applies)

 Hope that helps.
 Jeromy Evans

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]








  

Doubleselect tag quesitons

2008-09-09 Thread Jipu Jiang
Hello Everyone,

Here I got a question regarding to the s:doubleselect tag. 

Here is the scenario. I would like to display a complex hierarchy of
objects by using struts2 tags. Basically, I got 5 tables in the DB. All
linked with each other by Foreign Keys. So the models generated from the
tables are all linked with each other in a tree hierarchy. So when you
refer to the section object in the JSP page, you can get others through
links. The 5 data models contains following properties;

Section:
private Integer sectionId;
private String name;
private Set parameters = new HashSet(0);Parameter, contains: int
paramId

Parameter:
private Integer paramId;
private Section section;
private Menu menu;
private String type;
private String label;

Menu:
private Integer menuId;
private String name;
private Set menuoptions = new HashSet(0);
private Set parameters = new HashSet(0);
Menuoption:
private Integer optionId;
private Menu menu;
private String value;
private String score;
private Byte tertiary;
private Set tertiaryoptions = new HashSet(0);

TertiaryOption:
private Integer tertiaryId;
private Menuoption menuoption;
private String name;

The idea is the page contains several sections, each sections contains
several parameters, each parameter can be just a string or a menu, if it
is menu, there will be options in the menu, and if this menu contains
tertiary menu, then the tertiary menu would shown based on the selection
of the menu. 

So I would like to display this hierarchy in the JSP page by using
truts2 tags. I use s:iterator to go through a List of sections. Then
go through the Set of parameters with iterator tag again. Then display
the options linked to this parameters. In case of tertiary options
exist, i need a doubleselect tag. But I cant get the second select box
to show it's contents. 

I believe I know the reason is because the doublelist cant find a list
or map to show. But I don't know how to deal with such situations where
the list contains a list of objects, which contents a Collection to be
shown as the doublelist. I am still new to struts2. Could anyone please
tell me how to do this?

Many thanks,
Jipu 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Sorting with displaytag issue due to theme=ajax

2008-09-09 Thread Francisco Exposito

I am trying to show a table with some data using displaytag. I have a main page 
which contains the div which will contain the table with the data. Therefore I 
have in the main page s:head theme=ajax.

Then in the results page I have the display:table which shows the data. 


But when I click over a column to sort or over a pagination number, I receive 
the error Nothing to display in the complete page, not in the div. How can I 
get the next results in the same div?

Also I've tried to use displayTagAjax. In order to use it, I define in the main 
page:

script src=src/javascript/displayTagAjax.js type=text/javascript/
script src=src/javascript/jquery.js type=text/javascript/

But when I reload this page, I receive the error jQuery is not defined and 
the error seems to be in the line of displayTagAjax.js: 

jQuery(function($) {
changeLinks();
}); 


Thanks in advance.






_
Llega la nueva temporada. Consulta las nuevas tendencias en MSN Estilo
http://estilo.es.msn.com/moda/

Re: Sorting with displaytag issue due to theme=ajax

2008-09-09 Thread Dave Newton
--- On Tue, 9/9/08, Francisco Exposito wrote:
 But when I reload this page, I receive the error
 jQuery is not defined and the error seems to be
 in the line of displayTagAjax.js: 
 
 jQuery(function($) {
 changeLinks();
 }); 

It looks like the Ajax version of displaytag uses jQuery. Are you loading 
jQuery? Have you tried asking on a displaytag site/list/forum or wherever this 
tag lives?

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Sorting with displaytag issue due to theme=ajax

2008-09-09 Thread Francisco Exposito

Yes, it uses jquery. If I don't use struts2 ajax, it works properly. But when I 
use it, I receive the error jquery is not defined.

This code works properly: 


%@ page import=ads.web.action.UsuarioAction%
%@ taglib uri=http://displaytag.sf.net; prefix=display %

%
  Object result = session.getAttribute( result );

   //if( result == null ) 
   {
   UsuarioAction ac = new UsuarioAction();
   System.out.println(ac.getTodosUsuarios());
   session.setAttribute( result, ac.getTodosUsuarios() );
   }
%
html
head

script language='javascript' src=../../src/javascript/jquery.js 
type=text/javascript/script
script src=../../src/javascript/displayTagAjax.js

/script
/head
body


div id=ajxDspId  
display:table name=sessionScope.result pagesize=2  htmlId=dispTable 
sort=list
display:column property=idUsuario title=ID /
display:column property=nombre sortable=true/
display:column property=mail sortable=true/

  /display:table
/div
!--- end display tag --

script

/script
/body
/html



but not this one:


html
head
script src=src/javascript/optiontransferselect.js 
type=text/javascript/
script language='javascript' src=src/javascript/jquery.js 
type=text/javascript/script
   
script src=src/javascript/displayTagAjax.js

s:head theme=ajax/
link rel=stylesheet media=all type=text/css 
href=src/css/default.css /
script src=src/javascript/stuHover.js 
type=text/javascript/script

/head

body  
  CODE TO GO TO THE TABLE PAGE INSIDE THE DIV divContenedor

s:div id=divContenedor theme=ajax
s:actionerror/
s:actionmessage/
/s:div
 /body




 Date: Tue, 9 Sep 2008 04:14:50 -0700
 From: [EMAIL PROTECTED]
 Subject: Re: Sorting with displaytag issue due to theme=ajax
 To: user@struts.apache.org
 
 --- On Tue, 9/9/08, Francisco Exposito wrote:
  But when I reload this page, I receive the error
  jQuery is not defined and the error seems to be
  in the line of displayTagAjax.js: 
  
  jQuery(function($) {
  changeLinks();
  }); 
 
 It looks like the Ajax version of displaytag uses jQuery. Are you loading 
 jQuery? Have you tried asking on a displaytag site/list/forum or wherever 
 this tag lives?
 
 Dave
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

_
¡Entra en el Club oficial de Messenger y te enterarás de todas las novedades! 
http://www.vivelive.com/ilovemessenger

Re: JBoss 5 RC1 and Struts 2 : Simple validation error (URI scheme is not file)

2008-09-09 Thread Jeromy Evans

Bobby Mitch wrote:

Any other suggestion, anyone ?
Thanks for helping.
  


Did you try my suggestion of changing the doctype to point to a local 
file? Or a local catalog?

Or perhaps even removing the doctype?

It appears to be failing to parse the XML and the only URI present is in 
the doctype.


java.lang.IllegalArgumentException: URI scheme is not file
at java.io.File.(Unknown Source)
at 
com.opensymphony.xwork2.validator.ValidatorFactory.parseValidators(ValidatorFactory.java:323)



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Sorting with displaytag issue due to theme=ajax

2008-09-09 Thread Dave Newton
--- On Tue, 9/9/08, Francisco Exposito wrote:
 Yes, it uses jquery. If I don't use struts2 ajax, it
 works properly. But when I use it, I receive the error
 jquery is not defined.
 
 This code works properly: 
 [...] script language='javascript'
   src=../../src/javascript/jquery.js
   type=text/javascript/script
   script src=../../src/javascript/displayTagAjax.js
   /script
 [...]
 
 but not this one:
 [...] script language='javascript'
   src=src/javascript/jquery.js
   type=text/javascript/script
   script src=src/javascript/displayTagAjax.js

You should build the URLs for the JS files using JSTL or s:url..., if nothing 
else.

Under Firebug is it clear that the jQuery file is even being loaded? It doesn't 
sound like it.

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: NullPointerException with Validation Messages

2008-09-09 Thread Pascal Lalonde

Have you tried this ?

validators
   field name=userName
   field-validator type=requiredstring
   message key=requiredString/
   !--message key=requiredStringBoo/message--
   /field-validator
   /field
   field name=password
   field-validator type=requiredstring
   message key=requiredString/
   /field-validator
   /field
/validators


- Pascal


Mark wrote:

Hi all:

I'm using Struts 2 validation and I'm getting a NullPointerException 
when the page is being displayed (before it is even being submitted or 
validated).  I did some searches and found this Jira: 
https://issues.apache.org/struts/browse/WW-2150.  It states that it 
has been fixed in version 2.1.3.  I've updated to the latest SNAPSHOT 
of 2.1.3 and I'm still getting the error.


The problem seems to be with the message key... validation.  If I 
change it to message it works.


Can someone confirm there is not a problem with my setup?

Thanks in advance,
Mark

My directory structure is as following:

com.myapp.struts
|
- LoginAction.java
- LoginAction-validation.xml
- package.properties

LoginAction-validation.xml:
=
?xml version=1.0 encoding=UTF-8?
!DOCTYPE validators PUBLIC
-//OpenSymphony Group//XWork Validator 1.0.2//EN
http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd 

validators
field name=userName
field-validator type=requiredstring
message key=requiredStringBoo/message
/field-validator
/field
field name=password
field-validator type=requiredstring
messagePlease enter a Password/message
/field-validator
/field
/validators

package.properties

other lines have been snipped
requiredString=${getText(fieldName)} is required.

login.jsp

other lines have been snipped
   div id=login
h2 align=centerWelcome!/h2
center
!--s:actionerror /--
s:if test=hasActionErrors()
span class=errorMessage
s:iterator value=actionErrors
s:property escape=false/
/s:iterator
/span
/s:if
s:form action=login method=POST validate=true
s:textfield label=Name name=userName 
maxlength=8 size=8px required=true/
s:password  label=Password name=password 
maxlength=8 size=8px required=true/

s:submit align=center value=Login/
   /s:form/center
!-- end #mainContent --
/div

struts.xml
==
struts
include file=struts-default.xml /
package name=Hotel extends=struts-default
   
interceptors
interceptor name=mySecurity 
class=com.myapp.struts.SecurityInterceptor/interceptor

interceptor-stack name=myStack
interceptor-ref name=defaultStack/
interceptor-ref name=mySecurity
param name=requiredRolesuser/param
/interceptor-ref
/interceptor-stack
/interceptors
default-interceptor-ref name=myStack/

global-results
result name=noaccess/noaccess.jsp/result
/global-results

action name=login class=com.myapp.struts.LoginAction
result name=inputlogin.jsp/result
resultWEB-INF/mainmenu.jsp/result
/action
other lines snipped

Stack Trace:
==
008-09-09 11:05:07,521 ERROR [org.apache.struts2.components.UIBean] - 
error when rendering
Method public java.lang.String 
com.opensymphony.xwork2.validator.validators.ValidatorSupport.getMessage(java.lang.Object) 
threw an exception when invoked on 
[EMAIL PROTECTED] 


The problematic instruction:
--
== ${validator.getMessage(action)?js_string} [on line 51, column 26 
in template/xhtml/form-close-validate.ftl]
 in include /${parameters.templateDir}/xhtml/form-close-validate.ftl 
[on line 25, column 1 in template/xhtml/form-close.ftl]

--

Java backtrace for programmers:
--
freemarker.template.TemplateModelException: Method public 
java.lang.String 
com.opensymphony.xwork2.validator.validators.ValidatorSupport.getMessage(java.lang.Object) 
threw an exception when invoked on 
[EMAIL PROTECTED] 

at 
freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:130)

at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93)
at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
at freemarker.core.Expression.getStringValue(Expression.java:93)
at 
freemarker.core.StringBuiltins$StringBuiltIn._getAsTemplateModel(StringBuiltins.java:71) 


at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
at freemarker.core.Expression.getStringValue(Expression.java:93)
at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
  

RE: Sorting with displaytag issue due to theme=ajax

2008-09-09 Thread Martin Gainty

the referencing jsp page is including the jquery javascript file 
../../src/javascript/jquery.js

did you deploy all of your javascript libraries ..such as jquery.js to the 
struts webapp so the jsp can locate the js?

Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 


 Date: Tue, 9 Sep 2008 05:38:26 -0700
 From: [EMAIL PROTECTED]
 Subject: RE: Sorting with displaytag issue due to theme=ajax
 To: user@struts.apache.org
 
 --- On Tue, 9/9/08, Francisco Exposito wrote:
  Yes, it uses jquery. If I don't use struts2 ajax, it
  works properly. But when I use it, I receive the error
  jquery is not defined.
  
  This code works properly: 
  [...] script language='javascript'
src=../../src/javascript/jquery.js
type=text/javascript/script
script src=../../src/javascript/displayTagAjax.js
/script
  [...]
  
  but not this one:
  [...] script language='javascript'
src=src/javascript/jquery.js
type=text/javascript/script
script src=src/javascript/displayTagAjax.js
 
 You should build the URLs for the JS files using JSTL or s:url..., if 
 nothing else.
 
 Under Firebug is it clear that the jQuery file is even being loaded? It 
 doesn't sound like it.
 
 Dave
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

_
Want to do more with Windows Live? Learn “10 hidden secrets” from Jamie.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008

Re: [s2] Stream Result - no content length

2008-09-09 Thread Greg Lindholm


DNewfield wrote:
 
 If you do not specify the content length in the stream result, your 
 stream will be requested twice (each request is required to provide an 
 independent stream -- a frequent source of bugs for people that don't 
 realize it), one of which will be read through it's entirety just to 
 find the length, the other will be used to actually send out the data.
 
 -Dale
 
Your statement caused me to panic as my code was not prepared to 
return multiple independent streams and I'm not setting Content Length.

I jumped into the debugger and stepped through StreamResult and 
it doesn't appear to be true.The input stream is requested once and
written to the output stream.

Are you referring to something else? Please clarify. (A link to a reference 
would also be nice.)

On a related note, I'm downloading a file and I'm using a FileInputStream 
for my input stream.  Can I set the Content Length using File.length()? 
Or is there some munging that occurs to change the content length?

-- 
View this message in context: 
http://www.nabble.com/Stream-Windows-Executable-From-Linux-Machine-tp19331612p19394682.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Call a forward or a redirect inside an interceptor.

2008-09-09 Thread Ahmed ALAMI

Hello everybody,
Is there a way using the struts 2 API to forward or redirect to a url 
inside an interceptor instead of making a actionInvocation.invoke().

Thanks for reply.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: new to Struts

2008-09-09 Thread Edwin Quita
I would suggest you go straight towards Struts 2, it's simpler, you're
shielded from the dirty stuffs involved with the request and response
objects.  It also has spring integration and so make it easier for you
to integrate the model layer for your web app.

On Mon, Sep 8, 2008 at 7:25 AM, gbattine [EMAIL PROTECTED] wrote:

 Hello guys,
 I need an information.
 I'm going to learn struts..
 I need some info, please help me:

 1) what do you hint to me, to start from Struts 1.1 and later move to Struts
 2.0, or starting from Struts 2.0?
 2) I usually use Netbeans. Is there an editor WYSIWHG for Netbeans, to use
 Struts?
 3) I know ASP.NET technology and I used lot of already developed components,
 like editable grid, dropdown list and so on...does exists such component for
 struts?where I can download them?

 Thanks,
 Regards
 --
 View this message in context: 
 http://www.nabble.com/new-to-Struts-tp19370925p19370925.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Call a forward or a redirect inside an interceptor.

2008-09-09 Thread Chris Pratt
Sure, normally you would set up some global-results in your struts.xml
that your interceptor will redirect to then just return the name of the
result from your interceptor without ever calling actionInvocation.invoke().
  (*Chris*)

On Tue, Sep 9, 2008 at 9:05 AM, Ahmed ALAMI [EMAIL PROTECTED] wrote:

 Hello everybody,
 Is there a way using the struts 2 API to forward or redirect to a url
 inside an interceptor instead of making a actionInvocation.invoke().
 Thanks for reply.

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Call a forward or a redirect inside an interceptor.

2008-09-09 Thread Nuwan Chandrasoma

you can use response.sendRedirect() method inside an interceptor.


Ahmed ALAMI wrote:

Hello everybody,
Is there a way using the struts 2 API to forward or redirect to a url 
inside an interceptor instead of making a actionInvocation.invoke().

Thanks for reply.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Call a forward or a redirect inside an interceptor.

2008-09-09 Thread Ahmed ALAMI

Great, but it doesn't feet my need.
The result to forward to is dynamic and depends on the execution of the 
interceptor.


Chris Pratt a écrit :

Sure, normally you would set up some global-results in your struts.xml
that your interceptor will redirect to then just return the name of the
result from your interceptor without ever calling actionInvocation.invoke().
  (*Chris*)

On Tue, Sep 9, 2008 at 9:05 AM, Ahmed ALAMI [EMAIL PROTECTED] wrote:

  

Hello everybody,
Is there a way using the struts 2 API to forward or redirect to a url
inside an interceptor instead of making a actionInvocation.invoke().
Thanks for reply.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Call a forward or a redirect inside an interceptor.

2008-09-09 Thread Chris Pratt
That's normally handled more appropriately in an Action, but if you must do
it in an interceptor, you may have to go with Nuwan's idea of using
request.sendRedirect from the Interceptor and returning null without calling
invoke()
  (*Chris*)

On Tue, Sep 9, 2008 at 9:22 AM, Ahmed ALAMI [EMAIL PROTECTED] wrote:

 Great, but it doesn't feet my need.
 The result to forward to is dynamic and depends on the execution of the
 interceptor.

 Chris Pratt a écrit :

  Sure, normally you would set up some global-results in your struts.xml
 that your interceptor will redirect to then just return the name of the
 result from your interceptor without ever calling
 actionInvocation.invoke().
  (*Chris*)

 On Tue, Sep 9, 2008 at 9:05 AM, Ahmed ALAMI [EMAIL PROTECTED] wrote:



 Hello everybody,
 Is there a way using the struts 2 API to forward or redirect to a url
 inside an interceptor instead of making a actionInvocation.invoke().
 Thanks for reply.

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]









 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




struts tiles problem

2008-09-09 Thread Bipin Sadhwani
Hi everyone,
I have this wierd issue with tiles. Probably its a bug. 
My environment is:  Windows XP Professional, MyEclipse 6.0.1, Struts 2.0.6, 
Tiles 2.0.6, J2EE 1.4, JDK 5.0, JBoss 4.2.2
I am trying to insert a tile (a jsp page) into another tile (a jsp page) and so 
this is my config (simplified): 
  
tiles.xml 
- 
  
definition name=rootPage.index template=layout.jsp 
 put-attribute name=pagetitle value=Page Body Title / 
 put-attribute name=header value=header.jsp / 
 put-attribute name=footer value=footer.jsp / 
/definition 
  
definition name=searchEmployee.index extends=rootPage.index 
 put-attribute name=body value=searchEmpBody.index / 
 /definition 
definition name=searchEmpBody.index 
 template=/searchEmployee.jsp/ 
/definition 
  
definition name=status.index template=/status.jsp 
/definition 
  
layout.jsp 
--- 
  
body 
div class=container 
 div id=header 
 tiles:insertAttribute name=header / 
 /div 

 div id=mainContent 
 tiles:insertAttribute name=body / 
 /div 
/div 
/body 

Now following are the things I try on my searchEmployee.jsp 
  
searchEmployee.jsp - This works 

%@ taglib prefix=tiles uri=http://tiles.apache.org/tags-tiles;% 
%@ taglib prefix=s uri=/struts-tags % 
  
tiles:insertDefinition name=status.index/ 

searchEmployee.jsp - This also works 

%@ taglib prefix=tiles uri=http://tiles.apache.org/tags-tiles;% 
%@ taglib prefix=s uri=/struts-tags % 
  
s:form action=listEmployees 
 tiles:getAsString name=pagetitle/ 
/s:form 

searchEmployee.jsp - This does work (only if I use tiles:insertDefinition below 
s:form) 

%@ taglib prefix=tiles uri=http://tiles.apache.org/tags-tiles;% 
%@ taglib prefix=s uri=/struts-tags % 
  
s:form action=listEmployees 
/s:form 

tiles:insertDefinition name=status.index/ 

searchEmployee.jsp - This does NOT work (if I use tiles:insertDefinition above 
or within s:form things don't work) 

%@ taglib prefix=tiles uri=http://tiles.apache.org/tags-tiles;% 
%@ taglib prefix=s uri=/struts-tags % 
  
s:form action=listEmployees 
 tiles:insertDefinition name=status.index/ 
/s:form

I get a long exception stack trace which basically says nullptrexception. I'll 
send it in the next mail as there's size limit.

I've done the same thing using tiles1.x and it has always worked. 

Tks
Bipin


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



struts tiles problem - stack trace

2008-09-09 Thread Bipin Sadhwani
Here's the stack trace for the problem in my previous mail:

15:50:29,006 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at org.apache.struts2.components.Form.populateComponentHtmlId(Form.java:232)
at org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:738)
at org.apache.struts2.components.UIBean.end(UIBean.java:481)
at 
org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:43)
at 
org.apache.jsp.searchEmployee_jsp._jspx_meth_s_005fform_005f0(searchEmployee_jsp.java:114)
at org.apache.jsp.searchEmployee_jsp._jspService(searchEmployee_jsp.java:65)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at 
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:413)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
at 
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:557)
at 
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:481)
at 
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
at 
org.apache.jasper.runtime.PageContextImpl.doInclude(PageContextImpl.java:638)
at 
org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:632)
at 
org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestContext.java:80)
at 
org.apache.tiles.jsp.context.JspTilesRequestContext.dispatch(JspTilesRequestContext.java:73)
at 
org.apache.tiles.context.TilesRequestContextWrapper.dispatch(TilesRequestContextWrapper.java:72)
at 
org.apache.struts2.tiles.StrutsTilesRequestContext.dispatch(StrutsTilesRequestContext.java:86)
at 
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:606)
at 
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:280)
at 
org.apache.tiles.jsp.taglib.InsertAttributeTag.render(InsertAttributeTag.java:140)
at 
org.apache.tiles.jsp.taglib.InsertAttributeTag.render(InsertAttributeTag.java:117)
at 
org.apache.tiles.jsp.taglib.RenderTagSupport.execute(RenderTagSupport.java:154)
at 
org.apache.tiles.jsp.taglib.RoleSecurityTagSupport.doEndTag(RoleSecurityTagSupport.java:75)
at 
org.apache.tiles.jsp.taglib.ContainerTagSupport.doEndTag(ContainerTagSupport.java:80)
at 
org.apache.jsp.layouts.layout_jsp._jspx_meth_tiles_005finsertAttribute_005f1(layout_jsp.java:540)
at org.apache.jsp.layouts.layout_jsp._jspService(layout_jsp.java:257)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at 
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:413)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
at 
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:445)
at 
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)
at 
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
at 
org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:198)
at 
org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(ServletTilesRequestContext.java:179)
at 

SecurityFilter and Struts 1.3.8

2008-09-09 Thread mtStruts

Can anyone verify that they are successfully using the open source
SecurityFilter project with Struts 1.3.8?

Thanks!
-- 
View this message in context: 
http://www.nabble.com/SecurityFilter-and-Struts-1.3.8-tp19397254p19397254.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



ajax validation issue

2008-09-09 Thread Gawain Hammond
 

I've started using struts 2.1.2 as I was having some issues after
enabling client side javascript validation on forms (some page requests
hang, and clicking back takes you to the page you're supposed to be on).

 

I decided to use client side validation to avoid the problems of
populating form elements after validation fails (I'm using the action
tag to populate select drop-downs which I can't get to work after
validation errors return the page to the form).

 

Since moving to struts 2.1.2, I can't get client side validation to work
properly (some rules are skipped, but are then validated if the form
submits), and it only triggers after clicking the submit button (rather
than from the onblur event as in 2.0.11.x).

 

So I decided to try the ajax validation (seen on this page):

 

http://struts.apache.org/2.1.2/docs/ajax-validation.html

 

I've nearly done it, but now when I press submit I just get a browser
download of the json error fields, like so:

 

---

/* { fieldErrors: {daoDto.name:[Name must be in the format:
[A-Za-z0-9-_]*],daoDto.settings:[You must enter a value for
Settings]}} */

--- 

 

 

I've scoured over the tutorial for what I might have done wrong, and I'm
not too hot with javascript, so I'm left a little confused.

 

I notice the jsp in the tutorial has an s:url id=url
namespace=/validation../ tag which doesn't get used. Is there
supposed to be a different action for the ajax request than for the form
submission? 

 

I've set a hidden field in the form to set
struts.enableJSONValidation=true. Where else would I put this? I take it
this is making the submit to the action return the plain text json
notation?

 

 

Any Ideas?
--
This transmission is strictly confidential, possibly legally privileged, and 
intended solely for the 
addressee.  Any views or opinions expressed within it are those of the author 
and do not necessarily 
represent those of 192.com, i-CD Publishing (UK) Ltd or any of it's subsidiary 
companies.  If you 
are not the intended recipient then you must not disclose, copy or take any 
action in reliance of this 
transmission. If you have received this transmission in error, please notify 
the sender as soon as 
possible.  No employee or agent is authorised to conclude any binding agreement 
on behalf of 
i-CD Publishing (UK) Ltd with another party by email without express written 
confirmation by an 
authorised employee of the Company. http://www.192.com (Tel: 08000 192 192).  
i-CD Publishing (UK) Ltd 
is incorporated in England and Wales, company number 3148549, VAT No. GB 
673128728.

Re: [struts] [s2] Stream Result - no content length

2008-09-09 Thread Dale Newfield

Greg Lindholm wrote:
Your statement caused me to panic as my code was not prepared to 
return multiple independent streams and I'm not setting Content Length.


I swear I didn't make this up, as I clearly recall fighting these bugs 
myself...but you're right, as I cannot currently put my finger on the 
code that does this...(and it's not in StreamResult, where you and I 
both expected to find it, even looking back in the webwork revision 
history, so maybe we're looking in the wrong place?).


In case it's there and I'm just failing to find it, or in case this 
changes (back again?) in the future, is there any reason not to put your 
new FileInputStream(...) call in the action getter that returns the 
InputStream?


Are you referring to something else? Please clarify. (A link to a reference 
would also be nice.)


I wish I could.  I will stop providing this advice until I (re)find it's 
source.


On a related note, I'm downloading a file and I'm using a FileInputStream 
for my input stream.  Can I set the Content Length using File.length()? 
Or is there some munging that occurs to change the content length?


File.length() is the correct return value, and it can only help to 
specify it when known beforehand.


-Dale

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[S2]How can I get red error messages?

2008-09-09 Thread Ylva Degerfeldt
Hello, Struts users!

I'm just wondering how to make my error messages (specifically the
ones that Struts 2 generates) red, because currently they're not.
Isn't there some default css file I can use or do I have to create one?
And how do I use it in my jsp:s? (I know nothing about css.)

I appreciate any kind of help!

/Ylva

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [S2]How can I get red error messages?

2008-09-09 Thread Dave Newton
--- On Tue, 9/9/08, Ylva Degerfeldt wrote:
 I'm just wondering how to make my error messages (specifically the 
 ones that Struts 2 generates) red, because currently they're not.

Are you using the s:head/ tag tat includes the default Struts CSS?

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [S2]How can I get red error messages?

2008-09-09 Thread Ylva Degerfeldt
No, that was it! I wasn't using the s:head tag, but I am now.

Thank you, Dave!

Just out of curiosity.. If I would want to change these default style
settings, where could I find the file that I need to edit?

/Ylva

On Tue, Sep 9, 2008 at 8:10 PM, Dave Newton [EMAIL PROTECTED] wrote:
 --- On Tue, 9/9/08, Ylva Degerfeldt wrote:
 I'm just wondering how to make my error messages (specifically the
 ones that Struts 2 generates) red, because currently they're not.

 Are you using the s:head/ tag tat includes the default Struts CSS?

 Dave


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [S2]How can I get red error messages?

2008-09-09 Thread Dave Newton
--- On Tue, 9/9/08, Ylva Degerfeldt wrote:
 Just out of curiosity.. If I would want to change these
 default style settings, where could I find the file that
 I need to edit?

It'd be easier to just include your own stylesheet after the s:head tag and 
overwrite the styles.

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [S2]How can I get red error messages?

2008-09-09 Thread Pascal Lalonde
Didn't I read somewhere that one of the good practices was to copy the 
template folder in the project WEB-INF folder ? If this is true, then 
just directly edit the style sheet of the theme ?


- Pascal

Dave Newton wrote:

--- On Tue, 9/9/08, Ylva Degerfeldt wrote:
  

Just out of curiosity.. If I would want to change these
default style settings, where could I find the file that
I need to edit?



It'd be easier to just include your own stylesheet after the s:head tag and 
overwrite the styles.

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
  


Re: [S2]How can I get red error messages?

2008-09-09 Thread Ylva Degerfeldt
 It'd be easier to just include your own stylesheet after the s:head tag and 
 overwrite the styles.

Alright. Good to know. But that's for some time in the future when I
have more time - investigation.

Thanks!

/Ylva

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [S2]How can I get red error messages?

2008-09-09 Thread Dave Newton
--- On Tue, 9/9/08, Pascal Lalonde wrote:
 Didn't I read somewhere that one of the good practices
 was to copy the template folder in the project WEB-INF 
 folder? If this is true, then just directly edit the 
 style sheet of the theme?

Overwriting the styles is still easier. The template issue was largely an issue 
of FreeMarker template caching; the CSS file isn't a FreeMarker template.

The CSS file is served from the static resources, which (IIRC) ends up under 
/org/apache/struts2/static, on the classpath. If you view the source generated 
by the s:head tag, you'll see this:

link rel=stylesheet type=text/css
  href=/${context}/struts/xhtml/styles.css/

If S2 is serving the static files (the default) then it's easier to override 
the stylesheet by including your own.

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [struts] [s2] Stream Result - no content length

2008-09-09 Thread Greg Lindholm


DNewfield wrote:
 
 In case it's there and I'm just failing to find it, or in case this 
 changes (back again?) in the future, is there any reason not to put your 
 new FileInputStream(...) call in the action getter that returns the 
 InputStream?
 

That wouldn't work in the case I'm dealing with now.
I write the results out to a temp file then use a wrapper around 
FileInputStream() that deletes the file when the stream is closed.
-- 
View this message in context: 
http://www.nabble.com/Stream-Windows-Executable-From-Linux-Machine-tp19331612p19399074.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JBoss 5 RC1 and Struts 2 : Simple validation error (URI scheme is not file)

2008-09-09 Thread Bobby Mitch
hi, thanks again for helping.
What XML file exactly are you talking about ? The decriptor file strugs-tag.tld 
from the 

struts2-core-2.x.x.x file ?
I tried 3 versions already, here are the first lines of each 

version : struts-2.0.11.1
!DOCTYPE taglib PUBLIC -//Sun Microsystems, Inc.//DTD JSP Tag Library 
1.2//EN http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd;

version : struts-2.0.11.2
!DOCTYPE taglib PUBLIC -//Sun Microsystems, Inc.//DTD JSP Tag Library 
1.2//EN http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd;


version : struts-2.1.2
taglib xmlns=http://java.sun.com/xml/ns/j2ee; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; version=2.0 
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd;

Or are you talking about one of the descriptor tag files present in the xwork 
jar ?
xwork-2.x.x

So that would be xwork-2.x.dtd

I always get some URI scheme is not file error.
Here is an extract of the stack trace again :

Caused by: java.lang.RuntimeException: java.lang.RuntimeException: 
java.lang.reflect.InvocationTargetException
    at 
com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:480)
    at 
com.opensymphony.xwork2.inject.ContainerImpl$7.call(ContainerImpl.java:517)
    at 
com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:565)
    at 
com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:515)
    at 
com.opensymphony.xwork2.config.impl.LocatableFactory.create(LocatableFactory.java:32)
    at 
com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:135)
    ... 105 more
Caused by: java.lang.RuntimeException: 
java.lang.reflect.InvocationTargetException
    at 
com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:425)
    at 
com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:477)
    ... 110 more
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at 
com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:404)
    ... 111 more
Caused by: java.lang.IllegalArgumentException: URI scheme is not file
    at java.io.File.init(Unknown Source)
    at 
com.opensymphony.xwork2.validator.DefaultValidatorFactory.parseValidators(DefaultValidatorFactory.java:101)
    at 
com.opensymphony.xwork2.validator.DefaultValidatorFactory.init(DefaultValidatorFactory.java:43)
    ... 116 more

--- On Tue, 9/9/08, Jeromy Evans [EMAIL PROTECTED] wrote:
From: Jeromy Evans [EMAIL PROTECTED]
Subject: Re: JBoss 5 RC1 and Struts 2 : Simple validation error (URI scheme is 
not file)
To: Struts Users Mailing List user@struts.apache.org
Date: Tuesday, September 9, 2008, 4:56 AM

Bobby Mitch wrote:
 Any other suggestion, anyone ?
 Thanks for helping.
   

Did you try my suggestion of changing the doctype to point to a local 
file? Or a local catalog?
Or perhaps even removing the doctype?

It appears to be failing to parse the XML and the only URI present is in 
the doctype.

java.lang.IllegalArgumentException: URI scheme is not file
at java.io.File.(Unknown Source)
at
com.opensymphony.xwork2.validator.ValidatorFactory.parseValidators(ValidatorFactory.java:323)



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




  

Re: Sorting with displaytag issue due to theme=ajax

2008-09-09 Thread Laurie Harper

Francisco Exposito wrote:

Also I've tried to use displayTagAjax. In order to use it, I define in the main 
page:

script src=src/javascript/displayTagAjax.js type=text/javascript/
script src=src/javascript/jquery.js type=text/javascript/

But when I reload this page, I receive the error jQuery is not defined and the error seems to be in the line of displayTagAjax.js: 


jQuery(function($) {
changeLinks();
}); 


I assume it was a typo, since in a later email you have the order 
corrected. But just in case it's the obvious thing: since 
displayTagAjax.js conatains a call to jQuery, the jquery.js script needs 
to be loaded first...


L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: NullPointerException with Validation Messages

2008-09-09 Thread Mark
Thank you for the suggestion.  Yes, I have and it still produces the  
NullPointerException.

Mark

On 09/09/2008, at 10:45 PM, Pascal Lalonde wrote:


Have you tried this ?

validators
   field name=userName
   field-validator type=requiredstring
   message key=requiredString/
   !--message key=requiredStringBoo/message--
   /field-validator
   /field
   field name=password
   field-validator type=requiredstring
   message key=requiredString/
   /field-validator
   /field
/validators


- Pascal


Mark wrote:

Hi all:

I'm using Struts 2 validation and I'm getting a  
NullPointerException when the page is being displayed (before it  
is even being submitted or validated).  I did some searches and  
found this Jira: https://issues.apache.org/struts/browse/WW-2150.   
It states that it has been fixed in version 2.1.3.  I've updated  
to the latest SNAPSHOT of 2.1.3 and I'm still getting the error.


The problem seems to be with the message key... validation.  If  
I change it to message it works.


Can someone confirm there is not a problem with my setup?

Thanks in advance,
Mark

My directory structure is as following:

com.myapp.struts
|
- LoginAction.java
- LoginAction-validation.xml
- package.properties

LoginAction-validation.xml:
=
?xml version=1.0 encoding=UTF-8?
!DOCTYPE validators PUBLIC
-//OpenSymphony Group//XWork Validator 1.0.2//EN
http://www.opensymphony.com/xwork/xwork- 
validator-1.0.2.dtd 


validators
field name=userName
field-validator type=requiredstring
message key=requiredStringBoo/message
/field-validator
/field
field name=password
field-validator type=requiredstring
messagePlease enter a Password/message
/field-validator
/field
/validators

package.properties

other lines have been snipped
requiredString=${getText(fieldName)} is required.

login.jsp

other lines have been snipped
   div id=login
h2 align=centerWelcome!/h2
center
!--s:actionerror /--
s:if test=hasActionErrors()
span class=errorMessage
s:iterator value=actionErrors
s:property escape=false/
/s:iterator
/span
/s:if
s:form action=login method=POST validate=true
s:textfield label=Name name=userName  
maxlength=8 size=8px required=true/
s:password  label=Password name=password  
maxlength=8 size=8px required=true/

s:submit align=center value=Login/
   /s:form/center
!-- end #mainContent --
/div

struts.xml
==
struts
include file=struts-default.xml /
package name=Hotel extends=struts-default
   interceptors
interceptor name=mySecurity  
class=com.myapp.struts.SecurityInterceptor/interceptor

interceptor-stack name=myStack
interceptor-ref name=defaultStack/
interceptor-ref name=mySecurity
param name=requiredRolesuser/param
/interceptor-ref
/interceptor-stack
/interceptors
default-interceptor-ref name=myStack/

global-results
result name=noaccess/noaccess.jsp/result
/global-results

action name=login class=com.myapp.struts.LoginAction
result name=inputlogin.jsp/result
resultWEB-INF/mainmenu.jsp/result
/action
other lines snipped

Stack Trace:
==
008-09-09 11:05:07,521 ERROR  
[org.apache.struts2.components.UIBean] - error when rendering
Method public java.lang.String  
com.opensymphony.xwork2.validator.validators.ValidatorSupport.getMess 
age(java.lang.Object) threw an exception when invoked on  
com.opensymphony.xwork2.validator.validators.RequiredStringValidator@ 
3b1101

The problematic instruction:
--
== ${validator.getMessage(action)?js_string} [on line 51, column  
26 in template/xhtml/form-close-validate.ftl]
 in include /${parameters.templateDir}/xhtml/form-close- 
validate.ftl [on line 25, column 1 in template/xhtml/form-close.ftl]

--

Java backtrace for programmers:
--
freemarker.template.TemplateModelException: Method public  
java.lang.String  
com.opensymphony.xwork2.validator.validators.ValidatorSupport.getMess 
age(java.lang.Object) threw an exception when invoked on  
com.opensymphony.xwork2.validator.validators.RequiredStringValidator@ 
3b1101
at freemarker.ext.beans.SimpleMethodModel.exec 
(SimpleMethodModel.java:130)
at freemarker.core.MethodCall._getAsTemplateModel 
(MethodCall.java:93)
at freemarker.core.Expression.getAsTemplateModel 
(Expression.java:89)

at freemarker.core.Expression.getStringValue(Expression.java:93)
at 

Re: NullPointerException with Validation Messages

2008-09-09 Thread Dave Newton
--- On Tue, 9/9/08, Mark wrote:
 Thank you for the suggestion.  Yes, I have and it still
 produces the NullPointerException.

You may want to try putting the complete webapp up somewhere, or post a 
minimal, but complete, source example on something like pastebin/etc. I tried 
several different things to try to get the NPE but couldn't.

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: NullPointerException with Validation Messages

2008-09-09 Thread Dave Newton
--- On Tue, 9/9/08, Mark wrote:
 Thank you for the suggestion.  Yes, I have and it still
 produces the NullPointerException.

You may want to try putting the complete webapp up somewhere, or post a 
minimal, but complete, source example on something like pastebin/etc. I tried 
several different things to try to get the NPE but couldn't.

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



struts2-scope-plugin in websphere portal 6.1.0.0

2008-09-09 Thread Dinesh Narayanan
Dear all,
1. I would like to ask the experts if there are any known issues/design
considerations in using scope plugin(1.0.4) in a websphere portal. We have a
registration use case that involves conversation. He has to answer questions
across three screens, then the summary page and finally persist in the
database. And the concurrent hits are pretty high for our use case. I have
implemented the integration of scope plugin with our use case based on the
example provided in the trunk of struts2scopeplugin.googlecode.com and is
working great. My environment is websphere portal 6.1.0.0, struts 2.0.11.1

2. Which is recommended to work with session objects - using SessionAware or
Scope interceptor. Is this just a personnel preferrence?

Thanks
Dinesh Chandar.N


Re: NullPointerException with Validation Messages

2008-09-09 Thread Dave Newton
Here's something to try, although I still can't get the NPE, which is 
irritating and scary:

Your s:form's action is login, which means the DOM's form ... id will 
also be login. Because the markup is arguably somewhat brittle, your div 
id=login element is colliding with the form.

Try changing the div id to something like loginContainer or whatever and 
see what that does.

Dave

--- On Tue, 9/9/08, Dave Newton wrote:
 --- On Tue, 9/9/08, Mark wrote:
 Thank you for the suggestion.  Yes, I have and it
 still produces the NullPointerException.
 
 You may want to try putting the complete webapp up
 somewhere, or post a minimal, but complete, source example
 on something like pastebin/etc. I tried several different
 things to try to get the NPE but couldn't.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: NullPointerException with Validation Messages

2008-09-09 Thread Mark
I can zip up my complete maven directory and post it in the Jira.  Is  
that an appropriate place for it?  Or should I email it to you directly?


Mark

On 10/09/2008, at 8:45 AM, Dave Newton wrote:


--- On Tue, 9/9/08, Mark wrote:

Thank you for the suggestion.  Yes, I have and it still
produces the NullPointerException.


You may want to try putting the complete webapp up somewhere, or  
post a minimal, but complete, source example on something like  
pastebin/etc. I tried several different things to try to get the  
NPE but couldn't.


Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: NullPointerException with Validation Messages

2008-09-09 Thread Mark
I changed div id=login to div id=loginContainer, refreshed,  
and I still get the NPE :-(


If this help, I've also run into another problem which is related.   
If I implement the Validatable interface in my action, and then add a  
Field error (ie. addFieldError(userName, requiredString);) in the  
validate method, the message displayed is incomplete.  It will  
display is required instead of User Name is required.  Note that  
requiredString has ${getText(fieldName)} - the getText isn't  
returning the text.  When I look in the logs, there is a warning  
message (not a NPE) stating that I'm looking for a message key that  
is null.  I don't have the code currently setup to reproduce this  
problem, but I can if you'd like to see the exact warning message.  I  
think they are related because they both are producing a null message  
key.  Let me know what you think.


Thanks,
Mark


On 10/09/2008, at 9:17 AM, Dave Newton wrote:

Here's something to try, although I still can't get the NPE, which  
is irritating and scary:


Your s:form's action is login, which means the DOM's form ...  
id will also be login. Because the markup is arguably somewhat  
brittle, your div id=login element is colliding with the form.


Try changing the div id to something like loginContainer or  
whatever and see what that does.


Dave

--- On Tue, 9/9/08, Dave Newton wrote:

--- On Tue, 9/9/08, Mark wrote:

Thank you for the suggestion.  Yes, I have and it
still produces the NullPointerException.


You may want to try putting the complete webapp up
somewhere, or post a minimal, but complete, source example
on something like pastebin/etc. I tried several different
things to try to get the NPE but couldn't.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: NullPointerException with Validation Messages

2008-09-09 Thread Dave Newton
You're extending ActionSupport, right?

I'm also wondering if there's anything else on the value stack. Are you using 
an s:action... tag?

Dave


--- On Tue, 9/9/08, Mark [EMAIL PROTECTED] wrote:

 From: Mark [EMAIL PROTECTED]
 Subject: Re: NullPointerException with Validation Messages
 To: Struts Users Mailing List user@struts.apache.org
 Date: Tuesday, September 9, 2008, 7:32 PM
 I changed div id=login to div
 id=loginContainer, refreshed,  
 and I still get the NPE :-(
 
 If this help, I've also run into another problem which
 is related.   
 If I implement the Validatable interface in my action, and
 then add a  
 Field error (ie. addFieldError(userName,
 requiredString);) in the  
 validate method, the message displayed is incomplete.  It
 will  
 display is required instead of User Name
 is required.  Note that  
 requiredString has ${getText(fieldName)} - the getText
 isn't  
 returning the text.  When I look in the logs, there is a
 warning  
 message (not a NPE) stating that I'm looking for a
 message key that  
 is null.  I don't have the code currently setup to
 reproduce this  
 problem, but I can if you'd like to see the exact
 warning message.  I  
 think they are related because they both are producing a
 null message  
 key.  Let me know what you think.
 
 Thanks,
 Mark
 
 
 On 10/09/2008, at 9:17 AM, Dave Newton wrote:
 
  Here's something to try, although I still
 can't get the NPE, which  
  is irritating and scary:
 
  Your s:form's action is login,
 which means the DOM's form ...  
  id will also be login. Because the markup
 is arguably somewhat  
  brittle, your div id=login element
 is colliding with the form.
 
  Try changing the div id to something like
 loginContainer or  
  whatever and see what that does.
 
  Dave
 
  --- On Tue, 9/9/08, Dave Newton wrote:
  --- On Tue, 9/9/08, Mark wrote:
  Thank you for the suggestion.  Yes, I have and
 it
  still produces the NullPointerException.
 
  You may want to try putting the complete webapp up
  somewhere, or post a minimal, but complete, source
 example
  on something like pastebin/etc. I tried several
 different
  things to try to get the NPE but couldn't.
 
 
 
 -
  To unsubscribe, e-mail:
 [EMAIL PROTECTED]
  For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: NullPointerException with Validation Messages

2008-09-09 Thread Mark
Yes, all my actions are extending  
com.opensymphony.xwork2.ActionSupport.  Check the Jira for the full  
source to LoginAction.java.


No, I'm not using an s:action... tag.  Should I be?

Mark

On 10/09/2008, at 9:45 AM, Dave Newton wrote:


You're extending ActionSupport, right?

I'm also wondering if there's anything else on the value stack. Are  
you using an s:action... tag?


Dave


--- On Tue, 9/9/08, Mark [EMAIL PROTECTED] wrote:


From: Mark [EMAIL PROTECTED]
Subject: Re: NullPointerException with Validation Messages
To: Struts Users Mailing List user@struts.apache.org
Date: Tuesday, September 9, 2008, 7:32 PM
I changed div id=login to div
id=loginContainer, refreshed,
and I still get the NPE :-(

If this help, I've also run into another problem which
is related.
If I implement the Validatable interface in my action, and
then add a
Field error (ie. addFieldError(userName,
requiredString);) in the
validate method, the message displayed is incomplete.  It
will
display is required instead of User Name
is required.  Note that
requiredString has ${getText(fieldName)} - the getText
isn't
returning the text.  When I look in the logs, there is a
warning
message (not a NPE) stating that I'm looking for a
message key that
is null.  I don't have the code currently setup to
reproduce this
problem, but I can if you'd like to see the exact
warning message.  I
think they are related because they both are producing a
null message
key.  Let me know what you think.

Thanks,
Mark


On 10/09/2008, at 9:17 AM, Dave Newton wrote:


Here's something to try, although I still

can't get the NPE, which

is irritating and scary:

Your s:form's action is login,

which means the DOM's form ...

id will also be login. Because the markup

is arguably somewhat

brittle, your div id=login element

is colliding with the form.


Try changing the div id to something like

loginContainer or

whatever and see what that does.

Dave

--- On Tue, 9/9/08, Dave Newton wrote:

--- On Tue, 9/9/08, Mark wrote:

Thank you for the suggestion.  Yes, I have and

it

still produces the NullPointerException.


You may want to try putting the complete webapp up
somewhere, or post a minimal, but complete, source

example

on something like pastebin/etc. I tried several

different

things to try to get the NPE but couldn't.





-

To unsubscribe, e-mail:

[EMAIL PROTECTED]

For additional commands, e-mail:

[EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JBoss 5 RC1 and Struts 2 : Simple validation error (URI scheme is not file)

2008-09-09 Thread Jeromy Evans

Bobby Mitch wrote:

hi, thanks again for helping.
What XML file exactly are you talking about ? The decriptor file strugs-tag.tld from the 
  


The validators XML file you provided in your original email:

?xml version=1.0 encoding=UTF-8?
  !DOCTYPE validators PUBLIC 
 -//OpenSymphony Group//XWork Validator 1.0.2//EN 
 http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd;



Try removing the doctype, or changing the PUBLIC reference to one that 
points to a local copy of xwork-validator-1.0.2.dtd using the file 
protocol, or register this URI in an XML catalogue.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: NullPointerException with Validation Messages

2008-09-09 Thread Dave Newton
--- On Tue, 9/9/08, Mark wrote:
 No, I'm not using an s:action... tag.  Should I be?

Not if you don't need it.

Does it work if you have the validation XML file's DOCTYPE w/o the trailing 
space after .dtd ?

How are you accessing the login page the first time--through an action?

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ajax validation issue

2008-09-09 Thread Jeromy Evans

Gawain Hammond wrote:
 
...
  
That's a lot of problems, and to work-around each problem you've moved 
to a more sophisticated and complicated solution hoping for the best.


You'll need to get the plain-old-validation working first. If validation 
fails, your action's execute method is not invoked, so you need to 
ensure all the data needed by the page is available in that case.  eg. 
If you have a select that needs a list of values, then populate the list 
in the prepare method rather than the execute method.


Client-side validation is then generated from your server-side 
validation settings.  It'll only works with xhtml or css_xhtml theme'd 
forms with validate=true. If it fails in individual tags it's possible 
there's something wrong with the markup.  When you isolate it to certain 
fields your browser can help you work this out.


If you want to use ajax validation you'll need to ensure you're using 
the default interceptor stack for 2.1.2. It'll use your server-side 
validation settings.  You'll need the sx:head tag in your page and need 
to be attentive to where you use ajax theme'd tags verses other themes 
(eg. if you don't want the form posted via ajax).


I suggest you go back to basics; create a new minimal form with a 
minimal action and it get it to work.


Hope that helps,
Jeromy Evans



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: NullPointerException with Validation Messages

2008-09-09 Thread Dave Newton
Ah; there we go. The attached validation file in JIRA didn't have the key 
attribute; threw me off.

You're accessing the login page via the JSP, right? That won't work. You should 
access it through an action so there's an action on the stack so the getText() 
can be called on something that exists.

You can either configure a class-less action in the XML or get at it through 
dynamic method invocation:

/${context}/login!input.action

Dave

--- On Tue, 9/9/08, Dave Newton wrote:
 --- On Tue, 9/9/08, Mark wrote:
 No, I'm not using an s:action... tag. 
 Should I be?
 
 Not if you don't need it.
 
 Does it work if you have the validation XML file's
 DOCTYPE w/o the trailing space after .dtd ?
 
 How are you accessing the login page the first
 time--through an action?
 
 Dave
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: NullPointerException with Validation Messages

2008-09-09 Thread Mark
Ok, that makes sense.  How would I set that up?  Right now, I have an  
index.jsp with the following: jsp:forward page=login.jsp/.  This  
is so that someone accessing the site via http://localhost/ will be  
presented with the login page.


Mark

On 10/09/2008, at 10:20 AM, Dave Newton wrote:

Ah; there we go. The attached validation file in JIRA didn't have  
the key attribute; threw me off.


You're accessing the login page via the JSP, right? That won't  
work. You should access it through an action so there's an action  
on the stack so the getText() can be called on something that exists.


You can either configure a class-less action in the XML or get at  
it through dynamic method invocation:


/${context}/login!input.action

Dave

--- On Tue, 9/9/08, Dave Newton wrote:

--- On Tue, 9/9/08, Mark wrote:

No, I'm not using an s:action... tag.

Should I be?

Not if you don't need it.

Does it work if you have the validation XML file's
DOCTYPE w/o the trailing space after .dtd ?

How are you accessing the login page the first
time--through an action?

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: NullPointerException with Validation Messages

2008-09-09 Thread Dave Newton
--- On Tue, 9/9/08, Mark wrote:
 Ok, that makes sense.  How would I set that up?  Right now,
 I have an index.jsp with the following: jsp:forward
 page=login.jsp/.  This is so that someone accessing 
 the site via http://localhost/ will be presented with the 
 login page.

I generally just use a redirect scriptlet in an index.jsp to a login action, 
but that's probably old-fashioned these days.

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: NullPointerException with Validation Messages

2008-09-09 Thread Mark

GREAT!  That fixed it!  I'll update the Jira.  Thanks for your help!!!
Mark

On 10/09/2008, at 10:50 AM, Dave Newton wrote:


--- On Tue, 9/9/08, Mark wrote:

Ok, that makes sense.  How would I set that up?  Right now,
I have an index.jsp with the following: jsp:forward
page=login.jsp/.  This is so that someone accessing
the site via http://localhost/ will be presented with the
login page.


I generally just use a redirect scriptlet in an index.jsp to a  
login action, but that's probably old-fashioned these days.


Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JBoss 5 RC1 and Struts 2 : Simple validation error (URI scheme is not file)

2008-09-09 Thread Bobby Mitch
yes, but i wrote that with this XML file or without this XML file, that is with 
annotations only (@Validation etc), i still get the same error.
So i do not see the point of me trying to change that file.
And I want this to work with annotations too.

Thanks anyway for helping. 

--- On Tue, 9/9/08, Jeromy Evans [EMAIL PROTECTED] wrote:
From: Jeromy Evans [EMAIL PROTECTED]
Subject: Re: JBoss 5 RC1 and Struts 2 : Simple validation error (URI scheme is 
not file)
To: Struts Users Mailing List user@struts.apache.org
Date: Tuesday, September 9, 2008, 4:59 PM

Bobby Mitch wrote:
 hi, thanks again for helping.
 What XML file exactly are you talking about ? The decriptor file
strugs-tag.tld from the 
   

The validators XML file you provided in your original email:

?xml version=1.0 encoding=UTF-8?
   !DOCTYPE validators PUBLIC 
  -//OpenSymphony Group//XWork Validator 1.0.2//EN 
 
http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd;


Try removing the doctype, or changing the PUBLIC reference to one that 
points to a local copy of xwork-validator-1.0.2.dtd using the file 
protocol, or register this URI in an XML catalogue.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]