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

2008-09-07 Thread Bobby Mitch
Hi,
I am using JBoss RC 1 and Struts 2 and I am facing a problem when trying to use 
an XML validation file.
The error message i get is :
Code:

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


It looks like it is not happy with the XML validation file.
Here is the content of that file :
Code:

?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=name
    field-validator type=requiredstring
    messageYou must enter a name/message
    /field-validator
    /field
/validators 
  

I made some research and found out that someone already had the same error :
http://www.nabble.com/Simple-validation-does-not-work-td18894126.html
My code looks almost exactly like his.
He solved the problem by switching back to JBoss 4.0.5 which is not a 
convenient solution for me
since i want to stick with JBoss 5.

I also tried without an XML file for validation, using annotations only. And it 
turns out that I have the same problem.

Here is the complete stack trace :



Code:

07:15:07,378 INFO [ActionValidatorManagerFactory] Detected 
AnnotationActionValidatorManager, initial
izing it...
07:15:13,239 ERROR [[default]] Servlet.service() for servlet default threw 
exception
java.lang.IllegalArgumentException: URI scheme is not file
at java.io.File.(Unknown Source)
at 
com.opensymphony.xwork2.validator.ValidatorFactory.parseValidators(ValidatorFactory.java:323)
at 
com.opensymphony.xwork2.validator.ValidatorFactory.(ValidatorFactory.java:230)
at 
com.opensymphony.xwork2.validator.ValidatorFileParser.addValidatorConfigs(ValidatorFileParser.jav
a:192)
at 
com.opensymphony.xwork2.validator.ValidatorFileParser.parseActionValidatorConfigs(ValidatorFilePa
rser.java:72)
at 
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.loadFile(AnnotationActionValid
atorManager.java:361)
at 
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.buildClassValidatorConfigs(Ann
otationActionValidatorManager.java:252)
at 
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.buildValidatorConfigs(Annotati
onActionValidatorManager.java:340)
at 
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.getValidators(AnnotationAction
ValidatorManager.java:69)
at 
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValid
atorManager.java:138)
at 
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValid
atorManager.java:113)
at 
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValid
atorManager.java:100)
at 
com.opensymphony.xwork2.validator.ValidationInterceptor.doBeforeInvocation(ValidationInterceptor.
java:142)
at 
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:14
8)
at 
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationV
alidationInterceptor.java:48)
at 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.jav
a:86)
at 
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at 
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at 
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at 
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorIntercept
or.java:123)
at 
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at 
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at 
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at 
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:
186)
at 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.jav
a:86)
at 
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at 
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at 
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at 
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterce
ptor.java:105)
at 

Displaying BLOB image in a jsp page through struts...

2008-09-07 Thread Amir Hossein Sharifzadeh
Dear J2ee members
I am trying to display an image in a jsp page which is stored as a blob in the 
oracle table.
I wrote a stored procedure to get all the images for a particular id.

and in the servlet(action), I wrote the following:

    code:


    ResultSet rsImg = verServ.getImages(EtaId,conn);
    while(rsImg.next())
    {
 VDTO vadto = new VDTO();
 Blob Imgs = rsImg.getBlob(IMG);
 byte ImgData[] = Imgs.getBytes(1,(int)Imgs.length());
 vadto.setImgData(ImgData);
 vadto.setImgs(rsImg.getBlob(IMG));
 ImagesLst.add(vadto);
    }
    request.setAttribute(images,
 ImagesLst);



I am passing the Arraylist as a request Attribute to the jsp page, from where 
the Img tag calls a servlet passing the byte[].

Although I use Struts Framework, I would use jsp/struts tags for displaying my 
image(s) in jsp

Please guide me to write tags in jsp/struts for displaying my images.

-- Best
   Amir Hossein


  

Re: REST plug-in Tiles

2008-09-07 Thread stanlick
Thanks bro.  We have a big S2 app where every package uses tiles as the
default result type.  Tiles definitions are the name of the game.  I too
think dependencies between plug-ins should be mitigated.

Peace,
Scott

On Sat, Sep 6, 2008 at 7:34 PM, Jeromy Evans 
[EMAIL PROTECTED] wrote:

 [EMAIL PROTECTED] wrote:

 I don't understand how the codebehind or convention plug-in could provide
 the inheritance and layout functionality of tiles.  Moreover, we use
 conventions to tag CSS to tile definitions.  Can you elaborate please?




 Maybe I misinterpreted your intent.

 Codebehind/Convnetion is responsible for selecting a result.
 it'll first check if there's an explicit result (@Result);
 then search for a JSP matching the convention (eg. order-show.jsp or
 whatever);
 then search for a FTL and or VM file matching the convention.

 The Tiles plugin could augment this process, so if none of the above are
 matched:
 search for a Tile with a name matching (prefix.order.show, or whatever).

 So it wouldn't replace Tiles; it would just allow for the selection of
 Tiles based on a similar convention.
 Similarly, the UnknownHandler could attempt match a Tile if no action, jsp,
 ftl or vm file is found.

 I never looked further into it than that, but I expect the Tiles plugin
 could detect the presence of a convention plugin and augment its behaviour.
  We're not supposed to introduce dependencies between plugins though.


 None of this affects using tiles within pages. I've just been phasing out
 the use of TilesResult to use result-by-convention selection so I didn't
 have to write the above code.  My main purpose for using TilesResult (that
 is, to override the tiles at runtime) hasn't come up on a REST application
 yet.







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




prepare action for input after validation errors

2008-09-07 Thread Jean-Baptiste Nizet

Hello.

I'm reading the documentation for Struts 2 (after lots of work on Struts 
1 and Beehive), and I wonder if an interceptor exists in order to 
prepare the action after the validation fails, and before going back to 
the input page. Imagine the following action class :


public class MyAction extends ActionSupport {
  public String displayForm() {
 prepareForInput();
 return INPUT;
  }

  private void prepareForInput() {
 // go to the database and get some data in order to display it in 
the input form page

  }

  public String submitForm() {
 // this action is only called if validation succeeds
 // submits the form and returns a redirect result 
(redirect-after-post)

 return SUCCESS;
  }

  public void validateSubmitForm() {
 // validation logic for the submitForm action
 // after this call, if there is an error, the workflow interceptor 
will return the INPUT result, but the necessary data won't be in the action

 // because the prepareForInput method hasn't been called
  }
}

Is there an interceptor that would call my prepareForInput method?
I could call it in the validateSubmitForm method, but the validation 
logic would have a side effect, and I wouldn't be able to validate 
declaratively anymore.
I could call the prepareForInput method from the page, but the global 
exception handling wouldn't work (AFAIK) in the case an exception is 
thrown from this method.
I could use a Prepare interceptor, but the it would prepare regardless 
of the result of the validation.
The best way I see would be to use a subclass of the workflow 
interceptor (or add another interceptor after validation) that would 
automatically call a method named, for example, postValidationError or 
postValidationErrorSubmitForm before returning the INPUT result. Is 
there such a beast? How do you usually solve this problem?


Thanks.

JB.

-
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-07 Thread Struts Two
What version of Struts are you using? If you are using struts version 2.0.12, 
then this is a known issue (for websphere users). From what I understand,The 
fix for this problem is not included in xwork-2.0.5. However, if you are using 
struts 2.1.2 you are not supposed to see this error.



- Original Message 
From: Bobby Mitch [EMAIL PROTECTED]
To: user@struts.apache.org
Sent: Sunday, September 7, 2008 6:17:45 AM
Subject: JBoss 5 RC1 and Struts 2 : Simple validation error (URI scheme is not 
file)

Hi,
I am using JBoss RC 1 and Struts 2 and I am facing a problem when trying to use 
an XML validation file.
The error message i get is :
Code:

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


It looks like it is not happy with the XML validation file.
Here is the content of that file :
Code:

?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=name
    field-validator type=requiredstring
    messageYou must enter a name/message
    /field-validator
    /field
/validators 
  

I made some research and found out that someone already had the same error :
http://www.nabble.com/Simple-validation-does-not-work-td18894126.html
My code looks almost exactly like his.
He solved the problem by switching back to JBoss 4.0.5 which is not a 
convenient solution for me
since i want to stick with JBoss 5.

I also tried without an XML file for validation, using annotations only. And it 
turns out that I have the same problem.

Here is the complete stack trace :



Code:

07:15:07,378 INFO [ActionValidatorManagerFactory] Detected 
AnnotationActionValidatorManager, initial
izing it...
07:15:13,239 ERROR [[default]] Servlet.service() for servlet default threw 
exception
java.lang.IllegalArgumentException: URI scheme is not file
at java.io.File.(Unknown Source)
at 
com.opensymphony.xwork2.validator.ValidatorFactory.parseValidators(ValidatorFactory.java:323)
at 
com.opensymphony.xwork2.validator.ValidatorFactory.(ValidatorFactory.java:230)
at 
com.opensymphony.xwork2.validator.ValidatorFileParser.addValidatorConfigs(ValidatorFileParser.jav
a:192)
at 
com.opensymphony.xwork2.validator.ValidatorFileParser.parseActionValidatorConfigs(ValidatorFilePa
rser.java:72)
at 
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.loadFile(AnnotationActionValid
atorManager.java:361)
at 
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.buildClassValidatorConfigs(Ann
otationActionValidatorManager.java:252)
at 
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.buildValidatorConfigs(Annotati
onActionValidatorManager.java:340)
at 
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.getValidators(AnnotationAction
ValidatorManager.java:69)
at 
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValid
atorManager.java:138)
at 
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValid
atorManager.java:113)
at 
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValid
atorManager.java:100)
at 
com.opensymphony.xwork2.validator.ValidationInterceptor.doBeforeInvocation(ValidationInterceptor.
java:142)
at 
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:14
8)
at 
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationV
alidationInterceptor.java:48)
at 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.jav
a:86)
at 
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at 
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at 
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at 
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorIntercept
or.java:123)
at 
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at 
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at 
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at 
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:
186)
at 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.jav
a:86)
at 

[S2]checkboxlist tag bug?

2008-09-07 Thread Ryan Wong

I've used checkboxlist tag with JDK 5 enum
like:

[EMAIL PROTECTED] key=resource.requestMethod name=requestMethods
list=@[EMAIL PROTECTED]() listKey=name()
listValue=name() /]

every thing is OK, and the data can be persist to the database correctly.
but when I query the edit page, the previous data cannot be display well
(the box is not Checked!)

for the source, check the attachments.

I have debug the code, And the persist object had returned the correct enum
data array.

but the same page, the radio is OK, also used enum in JDK 5, I have check
the template and value stack, everything seems OK  I've got no idea,
It's a bug or just I have missed something?

http://www.nabble.com/file/p19359355/resources-edit.ftl resources-edit.ftl 
http://www.nabble.com/file/p19359355/Resource.java Resource.java 
http://www.nabble.com/file/p19359355/RequestMethod.java RequestMethod.java 

-
Blog: http://www.ryanwong.name
Can Use: English, Chinese
-- 
View this message in context: 
http://www.nabble.com/-S2-checkboxlist-tag-bug--tp19359355p19359355.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: Displaying BLOB image in a jsp page through struts...

2008-09-07 Thread Ryan Wong

Well, in my previous project, using JasperReports, I need to display a server
create Image to user.
I used a Image Servlet (and I believe it's the standard method) the provide
the Image data, set the response content-type to image/jpeg or what ever.
and the action of struts is just to send the key of image in a string
variable. like String imageSrc.

and the client receive a html like  host/imageservlect?key=123456 

the data of the image could temporary store in the cache or some folder...

wish that could help. 



Amir Hossein Sharifzadeh-2 wrote:
 
 Dear J2ee members
 I am trying to display an image in a jsp page which is stored as a blob in
 the oracle table.
 I wrote a stored procedure to get all the images for a particular id.
 
 and in the servlet(action), I wrote the following:
 
     code:
 
 
     ResultSet rsImg = verServ.getImages(EtaId,conn);
     while(rsImg.next())
     {
  VDTO vadto = new VDTO();
  Blob Imgs = rsImg.getBlob(IMG);
  byte ImgData[] = Imgs.getBytes(1,(int)Imgs.length());
  vadto.setImgData(ImgData);
  vadto.setImgs(rsImg.getBlob(IMG));
  ImagesLst.add(vadto);
     }
     request.setAttribute(images,
  ImagesLst);
 
 
 
 I am passing the Arraylist as a request Attribute to the jsp page, from
 where the Img tag calls a servlet passing the byte[].
 
 Although I use Struts Framework, I would use jsp/struts tags for
 displaying my image(s) in jsp
 
 Please guide me to write tags in jsp/struts for displaying my images.
 
 -- Best
    Amir Hossein
 
 
 
 


-
Blog: http://www.ryanwong.name
Can Use: English, Chinese
-- 
View this message in context: 
http://www.nabble.com/Displaying-BLOB-image-in-a-jsp-page-through-struts...-tp19357020p19359471.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: Displaying BLOB image in a jsp page through struts...

2008-09-07 Thread Ryan Wong

and besides, you could use a struts2 action with result stream, but I'm not
sure how to do it in struts 1
but the pattern is the same..

Amir Hossein Sharifzadeh-2 wrote:
 
 Dear J2ee members
 I am trying to display an image in a jsp page which is stored as a blob in
 the oracle table.
 I wrote a stored procedure to get all the images for a particular id.
 
 and in the servlet(action), I wrote the following:
 
     code:
 
 
     ResultSet rsImg = verServ.getImages(EtaId,conn);
     while(rsImg.next())
     {
  VDTO vadto = new VDTO();
  Blob Imgs = rsImg.getBlob(IMG);
  byte ImgData[] = Imgs.getBytes(1,(int)Imgs.length());
  vadto.setImgData(ImgData);
  vadto.setImgs(rsImg.getBlob(IMG));
  ImagesLst.add(vadto);
     }
     request.setAttribute(images,
  ImagesLst);
 
 
 
 I am passing the Arraylist as a request Attribute to the jsp page, from
 where the Img tag calls a servlet passing the byte[].
 
 Although I use Struts Framework, I would use jsp/struts tags for
 displaying my image(s) in jsp
 
 Please guide me to write tags in jsp/struts for displaying my images.
 
 -- Best
    Amir Hossein
 
 
 
 


-
Blog: http://www.ryanwong.name
Can Use: English, Chinese
-- 
View this message in context: 
http://www.nabble.com/Displaying-BLOB-image-in-a-jsp-page-through-struts...-tp19357020p19359500.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: Problem with radiobuttons

2008-09-07 Thread Ryan Wong

I think all you need is some function provide by JavaScript.

Mitxel Mitxelisimo wrote:
 
 Hi, I´m trying to make a form to fill in a questionform that is composed
 by
 some questions and one radiobutton for each, and this is the problem,
 what can i do to this in my action? how i can fill in each radiobutton?
 
 the questionformbean has an questionbean`s array and this is that i don´t
 know to assign in jsp or action.
 
 
 thanks.
 
 


-
Blog: http://www.ryanwong.name
Can Use: English, Chinese
-- 
View this message in context: 
http://www.nabble.com/Problem-with-radiobuttons-tp19233063p19359520.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]



Multiple methods validation with custom result strings

2008-09-07 Thread Keios Titan
I have a quick question. I am using S2. I have multiple methods exposed in
my action and more than one method has forms attached to it. If I use the
action-method-validation.xml for separate methods then they all return INPUT
when they fail. I want some forms to goto a result defined by other result
strings. In other words, the hardcoded returning of INPUT doesnt work for my
use case, I would like to decide which result should be picked instead of
INPUT. How can I do this?

PS: I looked up the archive and google and could not find anything that
helps.

Regards
Keios


Configuration precedence

2008-09-07 Thread stanlick
Does this table imply file precedence and setting overrides?

http://struts.apache.org/2.x/docs/configuration-files.html


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

2008-09-07 Thread Bobby Mitch
Hi, thanks for your reply. I am using this version : struts-2.0.11.2.
I will try the version 2.1.2 and i hope it will work. I will let you know.

In the mean time, if you or other people have any other suggestion, please 
don't hesitate.
Thanks.


--- On Sun, 9/7/08, Struts Two [EMAIL PROTECTED] wrote:
From: Struts Two [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, 8:21 AM

What version of Struts are you using? If you are using struts version 2.0.12,
then this is a known issue (for websphere users). From what I understand,The fix
for this problem is not included in xwork-2.0.5. However, if you are using
struts 2.1.2 you are not supposed to see this error.



- Original Message 
From: Bobby Mitch 
To: user@struts.apache.org
Sent: Sunday, September 7, 2008 6:17:45 AM
Subject: JBoss 5 RC1 and Struts 2 : Simple validation error (URI scheme is not
file)

Hi,
I am using JBoss RC 1 and Struts 2 and I am facing a problem when trying to use
an XML validation file.
The error message i get is :
Code:

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


It looks like it is not happy with the XML validation file.
Here is the content of that file :
Code:

?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=name
    field-validator type=requiredstring
    messageYou must enter a name/message
    /field-validator
    /field
/validators 
  

I made some research and found out that someone already had the same error :
http://www.nabble.com/Simple-validation-does-not-work-td18894126.html
My code looks almost exactly like his.
He solved the problem by switching back to JBoss 4.0.5 which is not
a convenient solution for me
since i want to stick with JBoss 5.

I also tried without an XML file for validation, using annotations only. And it
turns out that I have the same problem.

Here is the complete stack trace :



Code:

07:15:07,378 INFO [ActionValidatorManagerFactory] Detected
AnnotationActionValidatorManager, initial
izing it...
07:15:13,239 ERROR [[default]] Servlet.service() for servlet default threw
exception
java.lang.IllegalArgumentException: URI scheme is not file
at java.io.File.(Unknown Source)
at
com.opensymphony.xwork2.validator.ValidatorFactory.parseValidators(ValidatorFactory.java:323)
at
com.opensymphony.xwork2.validator.ValidatorFactory.(ValidatorFactory.java:230)
at
com.opensymphony.xwork2.validator.ValidatorFileParser.addValidatorConfigs(ValidatorFileParser.jav
a:192)
at
com.opensymphony.xwork2.validator.ValidatorFileParser.parseActionValidatorConfigs(ValidatorFilePa
rser.java:72)
at
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.loadFile(AnnotationActionValid
atorManager.java:361)
at
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.buildClassValidatorConfigs(Ann
otationActionValidatorManager.java:252)
at
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.buildValidatorConfigs(Annotati
onActionValidatorManager.java:340)
at
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.getValidators(AnnotationAction
ValidatorManager.java:69)
at
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValid
atorManager.java:138)
at
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValid
atorManager.java:113)
at
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValid
atorManager.java:100)
at
com.opensymphony.xwork2.validator.ValidationInterceptor.doBeforeInvocation(ValidationInterceptor.
java:142)
at
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:14
8)
at
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationV
alidationInterceptor.java:48)
at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.jav
a:86)
at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorIntercept
or.java:123)
at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at

Re: Struts 2 Hibernate Examples?

2008-09-07 Thread tom` frost
STruts 2 in action has a good chapter on it.

On Sat, Aug 30, 2008 at 5:52 AM, Andrew Myers [EMAIL PROTECTED] wrote:

 Hi,

 I was hoping someone may be able to send me some links to some useful
 tutorials or sample apps using Struts 2 and Hibernate, or failing that
 any good books that might guide me through this.

 Any advice would be greatly appreciated.

 Thanks!
 Andrew.

 -
 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-07 Thread Struts Two
In my case, I have downgraded to 2.0.11.1 and it works fine ( I had some issues 
running the beta code on Websphere). I know ,for sure, that you will not be 
getting the exception in 2.0.11.1. 



- Original Message 
From: Bobby Mitch [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Sunday, September 7, 2008 4:45:07 PM
Subject: Re: JBoss 5 RC1 and Struts 2 : Simple validation error (URI scheme is 
not file)

Hi, thanks for your reply. I am using this version : struts-2.0.11.2.
I will try the version 2.1.2 and i hope it will work. I will let you know.

In the mean time, if you or other people have any other suggestion, please 
don't hesitate.
Thanks.


--- On Sun, 9/7/08, Struts Two [EMAIL PROTECTED] wrote:
From: Struts Two [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, 8:21 AM

What version of Struts are you using? If you are using struts version 2.0.12,
then this is a known issue (for websphere users). From what I understand,The fix
for this problem is not included in xwork-2.0.5. However, if you are using
struts 2.1.2 you are not supposed to see this error.



- Original Message 
From: Bobby Mitch 
To: user@struts.apache.org
Sent: Sunday, September 7, 2008 6:17:45 AM
Subject: JBoss 5 RC1 and Struts 2 : Simple validation error (URI scheme is not
file)

Hi,
I am using JBoss RC 1 and Struts 2 and I am facing a problem when trying to use
an XML validation file.
The error message i get is :
Code:

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


It looks like it is not happy with the XML validation file.
Here is the content of that file :
Code:

?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=name
    field-validator type=requiredstring
    messageYou must enter a name/message
    /field-validator
    /field
/validators 
  

I made some research and found out that someone already had the same error :
http://www.nabble.com/Simple-validation-does-not-work-td18894126.html
My code looks almost exactly like his.
He solved the problem by switching back to JBoss 4.0.5 which is not
a convenient solution for me
since i want to stick with JBoss 5.

I also tried without an XML file for validation, using annotations only. And it
turns out that I have the same problem.

Here is the complete stack trace :



Code:

07:15:07,378 INFO [ActionValidatorManagerFactory] Detected
AnnotationActionValidatorManager, initial
izing it...
07:15:13,239 ERROR [[default]] Servlet.service() for servlet default threw
exception
java.lang.IllegalArgumentException: URI scheme is not file
at java.io.File.(Unknown Source)
at
com.opensymphony.xwork2.validator.ValidatorFactory.parseValidators(ValidatorFactory.java:323)
at
com.opensymphony.xwork2.validator.ValidatorFactory.(ValidatorFactory.java:230)
at
com.opensymphony.xwork2.validator.ValidatorFileParser.addValidatorConfigs(ValidatorFileParser.jav
a:192)
at
com.opensymphony.xwork2.validator.ValidatorFileParser.parseActionValidatorConfigs(ValidatorFilePa
rser.java:72)
at
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.loadFile(AnnotationActionValid
atorManager.java:361)
at
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.buildClassValidatorConfigs(Ann
otationActionValidatorManager.java:252)
at
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.buildValidatorConfigs(Annotati
onActionValidatorManager.java:340)
at
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.getValidators(AnnotationAction
ValidatorManager.java:69)
at
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValid
atorManager.java:138)
at
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValid
atorManager.java:113)
at
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValid
atorManager.java:100)
at
com.opensymphony.xwork2.validator.ValidationInterceptor.doBeforeInvocation(ValidationInterceptor.
java:142)
at
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:14
8)
at
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationV
alidationInterceptor.java:48)
at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.jav
a:86)
at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at

Re: Display tag : how to format the page number, Please help

2008-09-07 Thread Zoran Avtarovski
I don¹t understand. Is it not working?

We¹re often customising the displaytag properties file and it works fine.

Z.
 
 Hello to all
  
 I am using the display tag to show the employee data , it showing the
 page banner in the following style.
 25 items found, displaying 1 to 10 [first] [previous] 1 2 3
 [next][last]
  
 I want give it a look of google page banner or any aother type as we see
 in the many sites.
 For the I modified the displaytag.properties file and include the
 following .
  
 paging.banner.full=div class=pagelinks align=righta href={1}img
 src= images/first.gif/aa href={2}img src=
 images/prev.gif/a{0}a href={3}img src= images/next.gif/aa
 href={4}img src= images/last.gif/a/div
  
 paging.banner.first=div class=pagelinks align=righta
 href={1}img 
src=images/first.gif/aa href={2}img
 src=images/previous.gif/a {0}
a href={3}img src=static/images/next.gif/aa href={4}img
 src=images/last.gif/a/div
  
 paging.banner.last=div class=pagelinks align=righta href={1}img
src=images/first.gif/aa href={2}img
 src=images/previous.gif/a {0}
a href={3}img src=images/next.gif/aa href={4}img
 src=images/last.gif/a/div
 export.banner=div class=pagelinks align=right{0}/div
  
 please help me
  
 thanks in advance
  




RE: Display tag : how to format the page number, Please help

2008-09-07 Thread Martin Gainty


you are trying to populate a href based on a call to a action class passing a 
different locale param
ul
   lia href=s:url action=Welcome?request_locale=en/English/a/li
   lia href=s:url action=Welcome?request_locale=ja/Japanese/a/li
   lia href=s:url action=Welcome?request_locale=ru/Russian/a/li
   lia href=s:url action=Welcome?request_locale=in/Indian/a/li
   lia href=s:url action=Welcome?request_locale=cn/Chinese/a/li
   lia href=s:url action=Welcome?request_locale=de/German/a/li
   lia href=s:url action=Welcome?request_locale=fr/French/a/li
/ul
 



The URL tag isn't meant to be used with a query string.  The best way to write 
this would be:

Use the param tag instead
s:url action=Welcome
 s:param name=request_locale value=en /
 s:param name=request_locale value=ja /
 s:param name=request_locale value=cn /
 s:param name=request_locale value=in /
 s:param name=request_locale value=de /
 s:param name=request_locale value=fr /
/s:url
http://struts.apache.org/2.0.11.2/docs/why-are-request-parameters-appended-to-our-hyperlinks.html
HTH
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: Mon, 8 Sep 2008 10:27:01 +1000
 Subject: Re: Display tag : how to format the page number, Please help
 From: [EMAIL PROTECTED]
 To: user@struts.apache.org; [EMAIL PROTECTED]
 
 I don¹t understand. Is it not working?
 
 We¹re often customising the displaytag properties file and it works fine.
 
 Z.
  
  Hello to all
   
  I am using the display tag to show the employee data , it showing the
  page banner in the following style.
  25 items found, displaying 1 to 10 [first] [previous] 1 2 3
  [next][last]
   
  I want give it a look of google page banner or any aother type as we see
  in the many sites.
  For the I modified the displaytag.properties file and include the
  following .
   
  paging.banner.full=div class=pagelinks align=righta href={1}img
  src= images/first.gif/aa href={2}img src=
  images/prev.gif/a{0}a href={3}img src= images/next.gif/aa
  href={4}img src= images/last.gif/a/div
   
  paging.banner.first=div class=pagelinks align=righta
  href={1}img 
 src=images/first.gif/aa href={2}img
  src=images/previous.gif/a {0}
 a href={3}img src=static/images/next.gif/aa href={4}img
  src=images/last.gif/a/div
   
  paging.banner.last=div class=pagelinks align=righta href={1}img
 src=images/first.gif/aa href={2}img
  src=images/previous.gif/a {0}
 a href={3}img src=images/next.gif/aa href={4}img
  src=images/last.gif/a/div
  export.banner=div class=pagelinks align=right{0}/div
   
  please help me
   
  thanks in advance
   
 
 

_
Stay up to date on your PC, the Web, and your mobile phone with Windows Live.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093185mrt/direct/01/

RE: s:head theme=ajax causing prob;em with s:url

2008-09-07 Thread Martin Gainty

pls display full jsp

thx,
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: Thu, 4 Sep 2008 11:15:10 -0700
 From: [EMAIL PROTECTED]
 To: user@struts.apache.org
 Subject: s:head theme=ajax causing prob;em with s:url
 
 
 Hi,
 
 Does anyone know of any problems with using s:head theme=ajax and
 s:url
 
 I have a jsp which uses s:head theme=ajax and as soon as I go this jsp,
 all other s:urls's in the page stops working. It just shows me the last
 link created.
 
 Any pointers/help regarding this will much appreciated.
 
 Thanks
 Tuni
 -- 
 View this message in context: 
 http://www.nabble.com/%3Cs%3Ahead-theme%3D%22ajax%22%3E-causing-prob-em-with-%3Cs%3Aurl%3E-tp19316767p19316767.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]
 

_
See how Windows Mobile brings your life together—at home, work, or on the go.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093182mrt/direct/01/

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

2008-09-07 Thread Bobby Mitch
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/

I then reference it in my JSP using %@ taglib prefix=s uri=/struts-tags %
I did not have that problem with the version struts-2.0.11.2

It does not validate. What do i need to do to validate it ?
Also I am not sure it will fix things because i am still seeing the error URI 
scheme is not file

I am downgrading to 2.0.11.1 now since you're telling me there is no such 
problem in this version.

thanks.

--- On Sun, 9/7/08, Struts Two [EMAIL PROTECTED] wrote:
From: Struts Two [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, 2:58 PM

In my case, I have downgraded to 2.0.11.1 and it works fine ( I had some issues
running the beta code on Websphere). I know ,for sure, that you will not be
getting the exception in 2.0.11.1. 



- Original Message 
From: Bobby Mitch 
To: Struts Users Mailing List user@struts.apache.org
Sent: Sunday, September 7, 2008 4:45:07 PM
Subject: Re: JBoss 5 RC1 and Struts 2 : Simple validation error (URI scheme is
not file)

Hi, thanks for your reply. I am using this version : struts-2.0.11.2.
I will try the version 2.1.2 and i hope it will work. I will let you know.

In the mean time, if you or other people have any other suggestion, please
don't hesitate.
Thanks.


--- On Sun, 9/7/08, Struts Two [EMAIL PROTECTED] wrote:
From: Struts Two [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, 8:21 AM

What version of Struts are you using? If you are using struts version 2.0.12,
then this is a known issue (for websphere users). From what I understand,The
fix
for this problem is not included in xwork-2.0.5. However, if you are using
struts 2.1.2 you are not supposed to see this error.



- Original Message 
From: Bobby Mitch 
To: user@struts.apache.org
Sent: Sunday, September 7, 2008 6:17:45 AM
Subject: JBoss 5 RC1 and Struts 2 : Simple validation error (URI scheme is not
file)

Hi,
I am using JBoss RC 1 and Struts 2 and I am facing a problem when trying to use
an XML validation file.
The error message i get is :
Code:

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


It looks like it is not happy with the XML validation file.
Here is the content of that file :
Code:

?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=name
    field-validator type=requiredstring
    messageYou must enter a name/message
    /field-validator
    /field
/validators 
  

I made some research and found out that someone already had the same error :
http://www.nabble.com/Simple-validation-does-not-work-td18894126.html
My code looks almost exactly like his.
He solved the problem by switching back to JBoss 4.0.5 which is not
a convenient solution for me
since i want to stick with JBoss 5.

I also tried without an XML file for validation, using annotations only. And it
turns out that I have the same problem.

Here is the complete stack trace :



Code:

07:15:07,378 INFO [ActionValidatorManagerFactory] Detected
AnnotationActionValidatorManager, initial
izing it...
07:15:13,239 ERROR [[default]] Servlet.service() for servlet default threw
exception
java.lang.IllegalArgumentException: URI scheme is not file
at java.io.File.(Unknown Source)
at
com.opensymphony.xwork2.validator.ValidatorFactory.parseValidators(ValidatorFactory.java:323)
at
com.opensymphony.xwork2.validator.ValidatorFactory.(ValidatorFactory.java:230)
at
com.opensymphony.xwork2.validator.ValidatorFileParser.addValidatorConfigs(ValidatorFileParser.jav
a:192)
at
com.opensymphony.xwork2.validator.ValidatorFileParser.parseActionValidatorConfigs(ValidatorFilePa
rser.java:72)
at
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.loadFile(AnnotationActionValid
atorManager.java:361)
at
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.buildClassValidatorConfigs(Ann
otationActionValidatorManager.java:252)
at
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.buildValidatorConfigs(Annotati
onActionValidatorManager.java:340)
at
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.getValidators(AnnotationAction
ValidatorManager.java:69)
at
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValid
atorManager.java:138)
at

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

2008-09-07 Thread Jeromy Evans

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]



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

2008-09-07 Thread Don Brown
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]