Null element in ListInteger

2009-02-03 Thread DavidCAIT

Hi,

I have a list of Integers and I want one of the options to be null (since it
is a search field). However, I get the following freemarker exception when
rendering my JSP:

 FreeMarker template error!

 Error on line 73, column 13 in template/simple/select.ftl
 stack.findValue('top') is undefined.
 It cannot be assigned to itemKey
 The problematic instruction:
 --
==gt; assignment: itemKey=stack.findValue('top') [on line 73, column 13
in template/simple/select.ftl]
  in user-directive s.iterator [on line 63, column 1 in
 template/simple/select.ftl]
 --

I am using Struts 2.0.11 with the following action:

public class simpleAction implements Preparable {

// both myList and value have a public getter and setter
private ListInteger myList = new ArrayListInteger();
private Integer value;

public String prepare() {

myList.add(null); // commenting out this line removes the runtime JSP
exception
for (int i = 0; i  60; i++) {
myList.add(i);
} } }

My JSP page:

html
body
s:form action=anotherAction
s:select list=myList /
s:submit /
/s:form
/body/html

Does anyone have any ideas or workarounds about how I can include a null
entry in a list of integers without getting this freemarker exception?
Thanks,

David
-- 
View this message in context: 
http://www.nabble.com/Null-element-in-List%3CInteger%3E-tp21812998p21812998.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



populate items using struts2 s:select

2009-02-03 Thread unnii

Hi all,

am new to struts2.. am struggling to get the result for populating items
from DB.

my requirement is to populate country, which is stored in DB, using struts2
and when u choose a particular country, another select box populate its
cities, which also stored in DB..

at first i tried, fetching the list from java class instead of DB... since
there is an example available in 
struts2-showcase-2.0.14,built in project of struts2.

when i imported struts2-showcase-2.0.14 and tried that program the
s:select is working.. so i thought to implement that into my project.. but
unfortunately it is not working.. 

i will post here and please have a look and try providing the reason :)

I paste here the example block of a program from struts2-showcase-2.0.14 :

Portion of Jsp file contains the list Like : example.jsp

s:form action=exampleSubmit  
s:select
tooltip=Choose Your Favourite Language
label=Favourite Language
list=favouriteLanguages
name=favouriteLanguage
listKey=key
listValue=description
emptyOption=true
headerKey=None
headerValue=None/


portion of java class file contains like the following: UITagExample.java

package com.mobitail.action; // i pasted this since i mentioned this in
struts.xml - u should not confuse :)

 public String execute() throws Exception {
return SUCCESS;
}

//constructor
public UITagExample() {
favouriteLanguages.add(new Language(EnglishKey, English
Language));
favouriteLanguages.add(new Language(FrenchKey, French
Language));
favouriteLanguages.add(new Language(SpanishKey, Spanish
Language));
}

public List getFavouriteLanguages() {
return favouriteLanguages;
}


public void setFavouriteLanguage(String favouriteLanguage) {
this.favouriteLanguage = favouriteLanguage;
}

public String getFavouriteLanguage() {
return favouriteLanguage;
}

// === inner class
public static class Language {
String description;
String key;

public Language(String key, String description) {
this.key = key;
this.description = description;
}

public String getKey() {
return key;
}
public String getDescription() {
return description;
}

}

portion of struts.xml

action name=exampleSubmit class=com.mobitail.action.UITagExample 
resultexample.jsp/result
result name=inputexample.jsp/result
/action


when i execute http://localhost:8080/mobitail.com/example.jsp .. result is a
blank page  

if example.jsp contains other tags like s:textfield with s:select ,
result is only a textfield .. select box is not shown...

and in the Eclipse Ganymede output window, the error is like the following:

SEVERE: Servlet.service() for servlet jsp threw exception
tag 'select', field 'list', name 'favouriteLanguage': The requested list key
'favouriteLanguages' could not be resolved as a
collection/array/map/enumeration/iterator type. Example: people or
people.{name} - [unknown location]
at 
org.apache.struts2.components.Component.fieldError(Component.java:231)
at org.apache.struts2.components.Component.findValue(Component.java:293)
at
org.apache.struts2.components.ListUIBean.evaluateExtraParams(ListUIBean.java:79)
at 
org.apache.struts2.components.Select.evaluateExtraParams(Select.java:99)
at org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:780)
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.example_jsp._jspx_meth_s_005fselect_005f0(example_jsp.java:383)
at
org.apache.jsp.example_jsp._jspx_meth_s_005fform_005f0(example_jsp.java:244)
at org.apache.jsp.example_jsp._jspService(example_jsp.java:111)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
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:416)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   

Re: Null element in ListInteger

2009-02-03 Thread DavidCAIT

I did find a workaround which is a bit undesirable.

If I change my ArrayList to a TreeMap and store the same value for the key
and the value then the problem disappears. However, it is a bit wasteful to
store each value in the list twice.

Any other ideas? If not, my workaround is good enough for me.


DavidCAIT wrote:
 
 Hi,
 
 I have a list of Integers and I want one of the options to be null (since
 it is a search field). However, I get the following freemarker exception
 when rendering my JSP:
 
 FreeMarker template error!
 
 Error on line 73, column 13 in template/simple/select.ftl
 stack.findValue('top') is undefined.
 It cannot be assigned to itemKey
 The problematic instruction:
 --
==gt; assignment: itemKey=stack.findValue('top') [on line 73, column 13
in template/simple/select.ftl]
  in user-directive s.iterator [on line 63, column 1 in
 template/simple/select.ftl]
 --
 
 I am using Struts 2.0.11 with the following action:
 
 public class simpleAction implements Preparable {
 
 // both myList and value have a public getter and setter
 private ListInteger myList = new ArrayListInteger();
 private Integer value;
 
 public String prepare() {
 
 myList.add(null); // commenting out this line removes the runtime JSP
 exception
 for (int i = 0; i  60; i++) {
 myList.add(i);
 } } }
 
 My JSP page:
 
 html
 body
 s:form action=anotherAction
 s:select list=myList /
 s:submit /
 /s:form
 /body/html
 
 Does anyone have any ideas or workarounds about how I can include a null
 entry in a list of integers without getting this freemarker exception?
 Thanks,
 
 David
 

-- 
View this message in context: 
http://www.nabble.com/Null-element-in-List%3CInteger%3E-tp21812998p21813376.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Null element in ListInteger

2009-02-03 Thread DavidCAIT

Actually that didn't work out when I tested it.

A TreeMap sorts elements by calling Object.equals. When it encounters my
null element, it tries to de-reference it and throws an exception.

HashMap does not produce any exceptions, but leaves my numbers in a very
strange order like:

3, 2, 4, 1, 5, 0

even though I inserted them in order.

In summary, I am still trying to have a list of numbers which also allows
null to be available through my user interface's select dropdown box.
Ideally I would like to use an ArrayList if I could resolve the freemarker
exception.

Thanks again,

David


DavidCAIT wrote:
 
 I did find a workaround which is a bit undesirable.
 
 If I change my ArrayList to a TreeMap and store the same value for the key
 and the value then the problem disappears. However, it is a bit wasteful
 to store each value in the list twice.
 
 Any other ideas? If not, my workaround is good enough for me.
 
 
 DavidCAIT wrote:
 
 Hi,
 
 I have a list of Integers and I want one of the options to be null (since
 it is a search field). However, I get the following freemarker exception
 when rendering my JSP:
 
 FreeMarker template error!
 
 Error on line 73, column 13 in template/simple/select.ftl
 stack.findValue('top') is undefined.
 It cannot be assigned to itemKey
 The problematic instruction:
 --
==gt; assignment: itemKey=stack.findValue('top') [on line 73, column 13
in template/simple/select.ftl]
  in user-directive s.iterator [on line 63, column 1 in
 template/simple/select.ftl]
 --
 
 I am using Struts 2.0.11 with the following action:
 
 public class simpleAction implements Preparable {
 
 // both myList and value have a public getter and setter
 private ListInteger myList = new ArrayListInteger();
 private Integer value;
 
 public String prepare() {
 
 myList.add(null); // commenting out this line removes the runtime JSP
 exception
 for (int i = 0; i  60; i++) {
 myList.add(i);
 } } }
 
 My JSP page:
 
 html
 body
 s:form action=anotherAction
 s:select list=myList /
 s:submit /
 /s:form
 /body/html
 
 Does anyone have any ideas or workarounds about how I can include a null
 entry in a list of integers without getting this freemarker exception?
 Thanks,
 
 David
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Null-element-in-List%3CInteger%3E-tp21812998p21813746.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Null element in ListInteger

2009-02-03 Thread Dave Newton

Use s:select...'s emptyOption attribute?

I mean, you can't just put a null into a list and expect to get a 
value from it--you could put an empty string, maybe; that might work 
with an Integer object to avoid getting a 0.


Dave

DavidCAIT wrote:

Actually that didn't work out when I tested it.

A TreeMap sorts elements by calling Object.equals. When it encounters my
null element, it tries to de-reference it and throws an exception.

HashMap does not produce any exceptions, but leaves my numbers in a very
strange order like:

3, 2, 4, 1, 5, 0

even though I inserted them in order.

In summary, I am still trying to have a list of numbers which also allows
null to be available through my user interface's select dropdown box.
Ideally I would like to use an ArrayList if I could resolve the freemarker
exception.

Thanks again,

David


DavidCAIT wrote:

I did find a workaround which is a bit undesirable.

If I change my ArrayList to a TreeMap and store the same value for the key
and the value then the problem disappears. However, it is a bit wasteful
to store each value in the list twice.

Any other ideas? If not, my workaround is good enough for me.


DavidCAIT wrote:

Hi,

I have a list of Integers and I want one of the options to be null (since
it is a search field). However, I get the following freemarker exception
when rendering my JSP:


FreeMarker template error!
Error on line 73, column 13 in template/simple/select.ftl
stack.findValue('top') is undefined.
It cannot be assigned to itemKey
The problematic instruction:
--
==gt; assignment: itemKey=stack.findValue('top') [on line 73, column 13

in template/simple/select.ftl]

 in user-directive s.iterator [on line 63, column 1 in
template/simple/select.ftl]
--

I am using Struts 2.0.11 with the following action:

public class simpleAction implements Preparable {

// both myList and value have a public getter and setter
private ListInteger myList = new ArrayListInteger();
private Integer value;

public String prepare() {

myList.add(null); // commenting out this line removes the runtime JSP
exception
for (int i = 0; i  60; i++) {
myList.add(i);
} } }

My JSP page:

html
body
s:form action=anotherAction
s:select list=myList /
s:submit /
/s:form
/body/html

Does anyone have any ideas or workarounds about how I can include a null
entry in a list of integers without getting this freemarker exception?
Thanks,

David








-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



ClassCastException: org.apache.struts.taglib.html.MessagesTei

2009-02-03 Thread Ken Bowen

Hi,

I have an old app which was developed under struts 1.2.8 using struts- 
tiles, and has undergone steady development.
However, /AS FAR AS  I KNOW/, no changes to the tags library files  
have been made for a long time.
Yet today, after rebuilding the project (using Project  Clean in  
Eclipse), I suddenly am getting this exception:


java.lang.ClassCastException: org.apache.struts.taglib.html.MessagesTei

(The full exception is shown at the end of this message)  I don't  
recall ever seeing this before, and am not sure what to do to solve  
the problem.


I'll greatly appreciate any suggestions anyone can offer.
Thanks in advance,
Ken Bowen

Feb 3, 2009 12:14:27 PM org.apache.catalina.core.ApplicationDispatcher  
invoke

SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.ClassCastException: org.apache.struts.taglib.html.MessagesTei
	at  
org 
.apache 
.jasper 
.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoImpl.java:417)
	at  
org 
.apache 
.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java: 
250)
	at  
org 
.apache 
.jasper.compiler.TagLibraryInfoImpl.init(TagLibraryInfoImpl.java:163)
	at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java: 
431)

at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:494)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1444)
at org.apache.jasper.compiler.Parser.parse(Parser.java:138)
	at  
org 
.apache.jasper.compiler.ParserController.doParse(ParserController.java: 
216)
	at  
org 
.apache.jasper.compiler.ParserController.parse(ParserController.java: 
103)

at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:154)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:315)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
	at  
org 
.apache 
.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
	at  
org 
.apache 
.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
	at  
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at  
org 
.apache 
.catalina 
.core 
.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 
290)
	at  
org 
.apache 
.catalina 
.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at  
org 
.apache 
.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java: 
630)
	at  
org 
.apache 
.catalina 
.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java: 
436)
	at  
org 
.apache 
.catalina 
.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
	at  
org 
.apache 
.catalina 
.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
	at  
org 
.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java: 
1063)
	at  
org 
.apache 
.struts 
.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
	at  
org 
.apache 
.struts 
.tiles 
.TilesRequestProcessor 
.processTilesDefinition(TilesRequestProcessor.java:239)
	at  
org 
.apache 
.struts 
.tiles 
.TilesRequestProcessor 
.internalModuleRelativeForward(TilesRequestProcessor.java:341)
	at  
org 
.apache 
.struts.action.RequestProcessor.processForward(RequestProcessor.java: 
560)
	at  
org 
.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 
209)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java: 
1194)

at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at  
org 
.apache 
.catalina 
.core 
.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 
290)
	at  
org 
.apache 
.catalina 
.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at  
org 
.apache 
.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 
233)
	at  
org 
.apache 
.catalina.core.StandardContextValve.invoke(StandardContextValve.java: 
191)
	at  
org 
.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java: 
128)
	at  
org 
.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java: 
102)
	at  
org 
.apache 
.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at  
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java: 
286)
	at  
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java: 
845)
	at org.apache.coyote.http11.Http11Protocol 
$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java: 
447)

at java.lang.Thread.run(Thread.java:613)
Feb 3, 2009 12:14:27 PM 

[S2] Ajax Anchor Tag

2009-02-03 Thread Hoying, Ken
 I would like to take advantage of the Struts 2 Ajax Anchor tag's functionality 
to build the url on the client based on an href and the parameters for a given 
form (formId).  However, I do not want the call to be made asynchronously.  I 
just want it to build the url and then get it normally.  I am using Struts 
2.0.11.1.  Is there a way that to accomplish this?

Thanks in advance,
Ken
-
***Note:The information contained in this message may be privileged
and confidential and protected from disclosure. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.  If you have
received this communication in error, please notify the Sender
immediately by replying to the message and deleting it from your
computer.  Thank you.  Premier Inc.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: [S2] Ajax Anchor Tag

2009-02-03 Thread Wes Wannemacher
On Tuesday 03 February 2009 14:39:25 Hoying, Ken wrote:
  I would like to take advantage of the Struts 2 Ajax Anchor tag's
 functionality to build the url on the client based on an href and the
 parameters for a given form (formId).  However, I do not want the call to
 be made asynchronously.  I just want it to build the url and then get it
 normally.  I am using Struts 2.0.11.1.  Is there a way that to accomplish
 this?

 Thanks in advance,
 Ken

I believe if you are using the simple theme (or any non-ajax theme) the url 
will be built and a link made for a synchronous request.

-Wes

-- 

Wes Wannemacher
Author - Struts 2 In Practice 
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: [S2] Ajax Anchor Tag

2009-02-03 Thread Hoying, Ken
 That is what I had hoped for.  Unfortunately, it appears that the formId 
property is only considered when using the ajax theme.

Thanks,
Ken

-Original Message-
From: Wes Wannemacher [mailto:w...@wantii.com]
Sent: Tuesday, February 03, 2009 2:45 PM
To: Struts Users Mailing List
Subject: Re: [S2] Ajax Anchor Tag

On Tuesday 03 February 2009 14:39:25 Hoying, Ken wrote:
  I would like to take advantage of the Struts 2 Ajax Anchor tag's
 functionality to build the url on the client based on an href and the
 parameters for a given form (formId).  However, I do not want the call
 to be made asynchronously.  I just want it to build the url and then
 get it normally.  I am using Struts 2.0.11.1.  Is there a way that to
 accomplish this?

 Thanks in advance,
 Ken

I believe if you are using the simple theme (or any non-ajax theme) the url 
will be built and a link made for a synchronous request.

-Wes

--

Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more 
http://www.manning.com/wannemacher


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


-
***Note:The information contained in this message may be privileged
and confidential and protected from disclosure. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.  If you have
received this communication in error, please notify the Sender
immediately by replying to the message and deleting it from your
computer.  Thank you.  Premier Inc.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Struts 2 In Action Sample Application

2009-02-03 Thread Wes Wannemacher
On Tuesday 03 February 2009 14:54:55 SanJ.SANJAY wrote:
 Has anyone faced this issue with Sample application??

 SanJ.SANJAY wrote:
  Has anyone here tried and tested the Sample Application code that comes
  for this book Struts 2 In Action ?
  I am having hard time to fix it. Currently I am facing the issues in
  applicationContext.xml file.
 

I have the following in my applicationContext.xml on the top - 

beans xmlns=http://www.springframework.org/schema/beans;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:tx=http://www.springframework.org/schema/tx;
xsi:schemaLocation=http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.0.xsd;

It is available as an example app for my work-in-progress... You can browse 
the code here - 

http://code.google.com/p/struts2inpractice/source/browse/#svn/trunk/ch04ex01

(it is the ch04ex01 example app).

I don't get any parse errors. I vaguely remember issues parsing XML in tomcat 
because some versions come with an XML parser in the common lib directory (I 
think the windows version comes with it) and other versions do not. I could be 
wrong here, my memory is getting sketchy in my old age, and I'm not convinced 
this is your problem.

-Wes

-- 

Wes Wannemacher
Author - Struts 2 In Practice 
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Struts 2 In Action Sample Application

2009-02-03 Thread SanJ.SANJAY

Even if I use the top content form your applicationContext.xml in chapter 4,
I get the same error..so wondering what else could eb the issue.

Here is what I used this time :
1 ?xml version=1.0 encoding=UTF-8?
2 beans xmlns=http://www.springframework.org/schema/beans;
3xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
4xmlns:tx=http://www.springframework.org/schema/tx;
5xsi:schemaLocation=http://www.springframework.org/schema/beans 
6http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
7http://www.springframework.org/schema/tx 
8http://www.springframework.org/schema/tx/spring-tx-2.0.xsd;
 
and the error still says... 

org.springframework.beans.factory.BeanDefinitionStoreException: Line 8 in
XML document from ServletContext resource [/WEB-INF/applicationContext.xml]
is invalid; nested exception is org.xml.sax.SAXParseException: Document root
element beans, must match DOCTYPE root null.
org.xml.sax.SAXParseException: Document root element beans, must match
DOCTYPE root null.
at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)



Wes Wannemacher wrote:
 
 On Tuesday 03 February 2009 14:54:55 SanJ.SANJAY wrote:
 Has anyone faced this issue with Sample application??

 SanJ.SANJAY wrote:
  Has anyone here tried and tested the Sample Application code that comes
  for this book Struts 2 In Action ?
  I am having hard time to fix it. Currently I am facing the issues in
  applicationContext.xml file.
 
 
 I have the following in my applicationContext.xml on the top - 
 
 beans xmlns=http://www.springframework.org/schema/beans;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns:tx=http://www.springframework.org/schema/tx;
 xsi:schemaLocation=http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
 http://www.springframework.org/schema/tx
 http://www.springframework.org/schema/tx/spring-tx-2.0.xsd;
 
 It is available as an example app for my work-in-progress... You can
 browse 
 the code here - 
 
 http://code.google.com/p/struts2inpractice/source/browse/#svn/trunk/ch04ex01
 
 (it is the ch04ex01 example app).
 
 I don't get any parse errors. I vaguely remember issues parsing XML in
 tomcat 
 because some versions come with an XML parser in the common lib directory
 (I 
 think the windows version comes with it) and other versions do not. I
 could be 
 wrong here, my memory is getting sketchy in my old age, and I'm not
 convinced 
 this is your problem.
 
 -Wes
 
 -- 
 
 Wes Wannemacher
 Author - Struts 2 In Practice 
 Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
 http://www.manning.com/wannemacher
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Struts-2-In-Action-Sample-Application-tp21798278p21817842.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Struts 2 In Action Sample Application

2009-02-03 Thread Wes Wannemacher
On Tuesday 03 February 2009 15:11:06 SanJ.SANJAY wrote:
 Even if I use the top content form your applicationContext.xml in chapter
 4, I get the same error..so wondering what else could eb the issue.

Do you have multiple versions of Spring, or anything else that might attempt 
to parse XML in your classpath (/WEB-INF/lib, common/lib, etc.) ?

-Wes

-- 

Wes Wannemacher
Author - Struts 2 In Practice 
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Struts 2 In Action Sample Application

2009-02-03 Thread SanJ.SANJAY

Has anyone faced this issue with Sample application??




SanJ.SANJAY wrote:
 
 Has anyone here tried and tested the Sample Application code that comes
 for this book Struts 2 In Action ?
 I am having hard time to fix it. Currently I am facing the issues in
 applicationContext.xml file.
 
 This is the header for XML file that comes with sample application code 
 
 
 ?xml version=1.0 encoding=UTF-8?
 !--  This is the Spring configuration file.  This file declares all of
 the Spring beans that
   will be used by the Struts 2 Portfolio, starting with 
 Chapter Nine.
 --
   beans
 xmlns=http://www.springframework.org/schema/beans;
  
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xmlns:tx=http://www.springframework.org/schema/tx;
   xsi:schemaLocation=
   http://www.springframework.org/schema/beans
 http://www.springframework.org/schema   
   /beans/spring-beans-2.0.xsd
 GETTING ERROR AT THIS LINEhttp://www.springframework.org/schema/tx
 http://www.springframework.org/schema/tx/spring-tx-2.0.xsd;
 
 
 I am getting the error :
 org.springframework.beans.factory.BeanDefinitionStoreException: Line 5 in
 XML document from ServletContext resource
 [/WEB-INF/applicationContext.xml] is invalid; nested exception is
 org.xml.sax.SAXParseException: Document root element beans,
 org.xml.sax.SAXParseException: Document root element beans, must match
 DOCTYPE root null.
 at
 org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
 Source)
 at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown
 Source)
 at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
 Source)
 at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
 Source)
 at
 org.apache.xerces.impl.dtd.XMLDTDValidator.rootElementSpecified(Unknown
 Source)
 at
 org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown
 Source)
 at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown
 Source)
 at
 org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
 Source)
 
 
 Any insights on this issue?
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Struts-2-In-Action-Sample-Application-tp21798278p21817526.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Struts 2 In Action Sample Application

2009-02-03 Thread Wes Wannemacher
On Tuesday 03 February 2009 15:27:02 SanJ.SANJAY wrote:
 I actually do not have in WEB-INF/lib, I have all the jars in a shred lib
 and add them in Eclipse and build. This is how I do for other projects
 also.


There is some sort of problem with the XML in parsing. I would try re-creating 
the file from scratch, or maybe trying a different app server. 

You could also try launching eclipse with the '-clean' parameter... 

Searches on google all seem to point to this problem being related to jar file 
clashes or problems with the XML itself. 

-Wes

-- 

Wes Wannemacher
Author - Struts 2 In Practice 
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: trouble deploying struts2 app to tomcat 1.5.0.05

2009-02-03 Thread Wick, Dan
Is there a way to get a good log of what's actually happening?  Can't
seem to get a stack that points at a specific problem.  I've been
staring at this so long that I don't know where to look next!

--Dan

Feb 3, 2009 2:28:21 PM org.apache.catalina.core.StandardContext
filterStart
SEVERE: Exception starting filter struts2
java.lang.ClassNotFoundException:
org.apache.struts2.dispatcher.FilterDispatcher
at
org.apache.catalina.loader.WebappClassLoader.loadClass(Unknown Source
)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(Unknown Source
)
at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(Unknown So
urce)
at
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(Unknown
 Source)
at
org.apache.catalina.core.ApplicationFilterConfig.init(Unknown Sourc
e)
at org.apache.catalina.core.StandardContext.filterStart(Unknown
Source)
at org.apache.catalina.core.StandardContext.start(Unknown
Source)
at org.apache.catalina.core.ContainerBase.start(Unknown Source)
at org.apache.catalina.core.StandardHost.start(Unknown Source)
at org.apache.catalina.core.ContainerBase.start(Unknown Source)
at org.apache.catalina.core.StandardEngine.start(Unknown Source)
at org.apache.catalina.core.StandardService.start(Unknown
Source)
at org.apache.catalina.core.StandardServer.start(Unknown Source)

 -Original Message-
 From: Wick, Dan [mailto:dan.w...@donaldson.com] 
 Sent: Monday, February 02, 2009 8:04 AM
 To: Struts Users Mailing List
 Subject: RE: trouble deploying struts2 app to tomcat 1.5.0.05
 
 Martin,
 
  we can be of more assistance if you send us the .project
 
 Here's the contents of the .project...not much there.
 *.project**
 ?xml version=1.0 encoding=UTF-8?
 projectDescription
   namepwww/name
   comment/comment
   projects
   /projects
   buildSpec
   buildCommand
   nameorg.eclipse.jdt.core.javabuilder/name
   arguments
   /arguments
   /buildCommand
   /buildSpec
   natures
   natureorg.eclipse.jdt.core.javanature/nature
   naturecom.sysdeo.eclipse.tomcat.tomcatnature/nature
   /natures
 /projectDescription
 *.project**
 
 *Here's the .classpath, shows the libs I'm using
 locally
 ?xml version=1.0 encoding=UTF-8?
 classpath
   classpathentry kind=src path=Source/src/
   classpathentry kind=lib
 path=G:/StWorking/dcic/source/www/WEB-INF/lib/activation.jar/
   classpathentry kind=lib
 path=Source/www/WEB-INF/lib/antlr-2.7.2.jar/
   classpathentry kind=lib
 path=Source/www/WEB-INF/lib/commons-beanutils-1.6.jar/
   classpathentry kind=lib
 path=Source/www/WEB-INF/lib/commons-chain-1.1.jar/
   classpathentry kind=lib
 path=G:/StWorking/pwww/Source/www/WEB-INF/lib/commons-collect
ions-3.1.j
 ar/
   classpathentry kind=lib
 path=G:/StWorking/pwww/Source/www/WEB-INF/lib/commons-fileupl
oad-1.1.1.
 jar/
   classpathentry kind=lib
 path=G:/StWorking/pwww/Source/www/WEB-INF/lib/commons-io-1.4.jar/
   classpathentry kind=lib
 path=Source/www/WEB-INF/lib/commons-logging-1.0.4.jar/
   classpathentry kind=lib
 path=G:/StWorking/pwww/Source/www/WEB-INF/lib/commons-validat
or-1.3.0.j
 ar/
   classpathentry kind=lib
 path=Source/www/WEB-INF/lib/freemarker-2.3.8.jar/
   classpathentry kind=lib
 path=G:/StWorking/dcic/source/www/WEB-INF/lib/mail.jar/
   classpathentry kind=lib
 path=Source/www/WEB-INF/lib/ognl-2.6.11.jar/
   classpathentry kind=lib
 path=Source/www/WEB-INF/lib/oro-2.0.8.jar/
   classpathentry kind=lib
 path=G:/StWorking/dcic/source/www/WEB-INF/lib/ostermillerutil
s_1_06_01.
 jar/
   classpathentry kind=lib
 path=Source/www/WEB-INF/lib/struts2-core-2.0.12.jar/
   classpathentry kind=lib
 path=Source/www/WEB-INF/lib/xwork-2.0.6.jar/
   classpathentry kind=con
 path=org.eclipse.jdt.launching.JRE_CONTAINER/
   classpathentry kind=lib
 path=C:/tomcat/apache-tomcat-5.5.17/common/lib/servlet-api.jar/
   classpathentry kind=output
 path=Source/www/WEB-INF/classes/
 /classpath
 
 
 Libs in my deployed app's war's /WEB-INF/lib are:
 WEB-INF/lib
 activation.jar
 antlr-2.7.2.jar
 commons-beanutils-1.6.jar
 commons-chain-1.1.jar
 commons-collections-3.1.jar
 commons-fileupload-1.1.1.jar
 commons-io-1.4.jar
 commons-logging-1.0.4.jar
 commons-validator-1.3.0.jar
 freemarker-2.3.8.jar
 mail.jar
 ognl-2.6.11.jar
 oro-2.0.8.jar
 ostermillerutils_1_06_01.jar
 struts2-core-2.0.12.jar
 xwork-2.0.6.jar
 *End WEB-INF/lib
 
 
  
  Martin
  __
  Disclaimer and confidentiality note
  Everything in this e-mail and any attachments relates to 
 the official 
  business of Sender. This transmission is 

What may cause ognl.InappropriateExpressionException warning ?

2009-02-03 Thread Emi Lu

Good morning,

When switching query result page by page (online), I got the following 
warning message:


WARNING: Error setting value
ognl.InappropriateExpressionException: Inappropriate OGNL expression: (d 
- 6836677) - p


I am lost. Could someone tell me what may cause this warning please?

Thanks a lot!

--
Lu Ying

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: What may cause ognl.InappropriateExpressionException warning ?

2009-02-03 Thread Emi Lu
When switching query result page by page (online), I got the following 
warning message:


WARNING: Error setting value
ognl.InappropriateExpressionException: Inappropriate OGNL expression: (d 
- 6836677) - p


I am lost. Could someone tell me what may cause this warning please?


Info searched for now :
http://www.junlu.com/msg/317273.html

But I already disabled devMode in struts.xml:
constant name=struts.enable.DynamicMethodInvocation value=false /
constant name=struts.devMode value=false /


By the way, I am using:
struts-core 2.1.6
displaytag-1.2.jar

Thanks,

--
Lu Ying

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: What may cause ognl.InappropriateExpressionException warning ?

2009-02-03 Thread Dave Newton
Wouldn't it make sense to include the JSP/expression that's causing the 
error?


Dave

Emi Lu wrote:
When switching query result page by page (online), I got the following 
warning message:


WARNING: Error setting value
ognl.InappropriateExpressionException: Inappropriate OGNL expression: 
(d - 6836677) - p


I am lost. Could someone tell me what may cause this warning please?


Info searched for now :
http://www.junlu.com/msg/317273.html

But I already disabled devMode in struts.xml:
constant name=struts.enable.DynamicMethodInvocation value=false /
constant name=struts.devMode value=false /


By the way, I am using:
struts-core 2.1.6
displaytag-1.2.jar

Thanks,

--
Lu Ying

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org





-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: What may cause ognl.InappropriateExpressionException warning ?

2009-02-03 Thread Musachy Barroso
If you are, the params interceptor doesn't like parameters with spaces
in the name (this was fixed in xwork already), to fix it, set
acceptedParamNames to [[\p{Graph}\s][^,#:=]]* in your param
interceptor.

musachy

On Tue, Feb 3, 2009 at 5:36 PM, Musachy Barroso musa...@gmail.com wrote:
 That looks familiar, are you using displaytag?

 musachy

 On Tue, Feb 3, 2009 at 4:39 PM, Dave Newton newton.d...@yahoo.com wrote:
 Wouldn't it make sense to include the JSP/expression that's causing the
 error?

 Dave

 Emi Lu wrote:

 When switching query result page by page (online), I got the following
 warning message:

 WARNING: Error setting value
 ognl.InappropriateExpressionException: Inappropriate OGNL expression: (d
 - 6836677) - p

 I am lost. Could someone tell me what may cause this warning please?

 Info searched for now :
 http://www.junlu.com/msg/317273.html

 But I already disabled devMode in struts.xml:
 constant name=struts.enable.DynamicMethodInvocation value=false /
 constant name=struts.devMode value=false /


 By the way, I am using:
 struts-core 2.1.6
 displaytag-1.2.jar

 Thanks,

 --
 Lu Ying

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org





 --
 Hey you! Would you help me to carry the stone? Pink Floyd




-- 
Hey you! Would you help me to carry the stone? Pink Floyd

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: What may cause ognl.InappropriateExpressionException warning ?

2009-02-03 Thread Musachy Barroso
That looks familiar, are you using displaytag?

musachy

On Tue, Feb 3, 2009 at 4:39 PM, Dave Newton newton.d...@yahoo.com wrote:
 Wouldn't it make sense to include the JSP/expression that's causing the
 error?

 Dave

 Emi Lu wrote:

 When switching query result page by page (online), I got the following
 warning message:

 WARNING: Error setting value
 ognl.InappropriateExpressionException: Inappropriate OGNL expression: (d
 - 6836677) - p

 I am lost. Could someone tell me what may cause this warning please?

 Info searched for now :
 http://www.junlu.com/msg/317273.html

 But I already disabled devMode in struts.xml:
 constant name=struts.enable.DynamicMethodInvocation value=false /
 constant name=struts.devMode value=false /


 By the way, I am using:
 struts-core 2.1.6
 displaytag-1.2.jar

 Thanks,

 --
 Lu Ying

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org





-- 
Hey you! Would you help me to carry the stone? Pink Floyd

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Display XMLGregorianCalendar as date on jsp page using type converter

2009-02-03 Thread bilobag

I have a collection of XMLGregorianCalendar objects that I would like to
display on a jsp page as a formatted date.  So far I have tried creating my
own converter class to convert XMLGregorianCalendar to java.util.Date, but I
can't seem to get it called properly.  What is the best way to get this list
to display on a jsp page as formatted dates?  I didn't see much
documentation on how to create a converter to convert from one object type
to another.  Another option is for me to be able to call the
XMLGregorianCalendar methods on the jsp page like below, but that didn't
seem to work either.  Anybody know the answer?


s:iterator value=scheduleList status=scheduleStatus
  s:date value=scheduleList.toGregorianCalendar().getTime()
format=dd/MM//
/s:iterator
-- 
View this message in context: 
http://www.nabble.com/Display-XMLGregorianCalendar-as-date-on-jsp-page-using-type-converter-tp21821248p21821248.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: trouble deploying struts2 app to tomcat 1.5.0.05

2009-02-03 Thread Musachy Barroso
The first time you listed the jars, the struts and xwork jars were not
in lib. Drop to a shell and run

$ unzip -l your_war_name.war | grep lib

and post the output.

musachy

On Tue, Feb 3, 2009 at 3:45 PM, Wick, Dan dan.w...@donaldson.com wrote:
 Is there a way to get a good log of what's actually happening?  Can't
 seem to get a stack that points at a specific problem.  I've been
 staring at this so long that I don't know where to look next!

 --Dan

 Feb 3, 2009 2:28:21 PM org.apache.catalina.core.StandardContext
 filterStart
 SEVERE: Exception starting filter struts2
 java.lang.ClassNotFoundException:
 org.apache.struts2.dispatcher.FilterDispatcher
at
 org.apache.catalina.loader.WebappClassLoader.loadClass(Unknown Source
 )
at
 org.apache.catalina.loader.WebappClassLoader.loadClass(Unknown Source
 )
at
 org.apache.catalina.core.ApplicationFilterConfig.getFilter(Unknown So
 urce)
at
 org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(Unknown
  Source)
at
 org.apache.catalina.core.ApplicationFilterConfig.init(Unknown Sourc
 e)
at org.apache.catalina.core.StandardContext.filterStart(Unknown
 Source)
at org.apache.catalina.core.StandardContext.start(Unknown
 Source)
at org.apache.catalina.core.ContainerBase.start(Unknown Source)
at org.apache.catalina.core.StandardHost.start(Unknown Source)
at org.apache.catalina.core.ContainerBase.start(Unknown Source)
at org.apache.catalina.core.StandardEngine.start(Unknown Source)
at org.apache.catalina.core.StandardService.start(Unknown
 Source)
at org.apache.catalina.core.StandardServer.start(Unknown Source)

 -Original Message-
 From: Wick, Dan [mailto:dan.w...@donaldson.com]
 Sent: Monday, February 02, 2009 8:04 AM
 To: Struts Users Mailing List
 Subject: RE: trouble deploying struts2 app to tomcat 1.5.0.05

 Martin,

  we can be of more assistance if you send us the .project

 Here's the contents of the .project...not much there.
 *.project**
 ?xml version=1.0 encoding=UTF-8?
 projectDescription
   namepwww/name
   comment/comment
   projects
   /projects
   buildSpec
   buildCommand
   nameorg.eclipse.jdt.core.javabuilder/name
   arguments
   /arguments
   /buildCommand
   /buildSpec
   natures
   natureorg.eclipse.jdt.core.javanature/nature
   naturecom.sysdeo.eclipse.tomcat.tomcatnature/nature
   /natures
 /projectDescription
 *.project**

 *Here's the .classpath, shows the libs I'm using
 locally
 ?xml version=1.0 encoding=UTF-8?
 classpath
   classpathentry kind=src path=Source/src/
   classpathentry kind=lib
 path=G:/StWorking/dcic/source/www/WEB-INF/lib/activation.jar/
   classpathentry kind=lib
 path=Source/www/WEB-INF/lib/antlr-2.7.2.jar/
   classpathentry kind=lib
 path=Source/www/WEB-INF/lib/commons-beanutils-1.6.jar/
   classpathentry kind=lib
 path=Source/www/WEB-INF/lib/commons-chain-1.1.jar/
   classpathentry kind=lib
 path=G:/StWorking/pwww/Source/www/WEB-INF/lib/commons-collect
 ions-3.1.j
 ar/
   classpathentry kind=lib
 path=G:/StWorking/pwww/Source/www/WEB-INF/lib/commons-fileupl
 oad-1.1.1.
 jar/
   classpathentry kind=lib
 path=G:/StWorking/pwww/Source/www/WEB-INF/lib/commons-io-1.4.jar/
   classpathentry kind=lib
 path=Source/www/WEB-INF/lib/commons-logging-1.0.4.jar/
   classpathentry kind=lib
 path=G:/StWorking/pwww/Source/www/WEB-INF/lib/commons-validat
 or-1.3.0.j
 ar/
   classpathentry kind=lib
 path=Source/www/WEB-INF/lib/freemarker-2.3.8.jar/
   classpathentry kind=lib
 path=G:/StWorking/dcic/source/www/WEB-INF/lib/mail.jar/
   classpathentry kind=lib
 path=Source/www/WEB-INF/lib/ognl-2.6.11.jar/
   classpathentry kind=lib
 path=Source/www/WEB-INF/lib/oro-2.0.8.jar/
   classpathentry kind=lib
 path=G:/StWorking/dcic/source/www/WEB-INF/lib/ostermillerutil
 s_1_06_01.
 jar/
   classpathentry kind=lib
 path=Source/www/WEB-INF/lib/struts2-core-2.0.12.jar/
   classpathentry kind=lib
 path=Source/www/WEB-INF/lib/xwork-2.0.6.jar/
   classpathentry kind=con
 path=org.eclipse.jdt.launching.JRE_CONTAINER/
   classpathentry kind=lib
 path=C:/tomcat/apache-tomcat-5.5.17/common/lib/servlet-api.jar/
   classpathentry kind=output
 path=Source/www/WEB-INF/classes/
 /classpath


 Libs in my deployed app's war's /WEB-INF/lib are:
 WEB-INF/lib
 activation.jar
 antlr-2.7.2.jar
 commons-beanutils-1.6.jar
 commons-chain-1.1.jar
 commons-collections-3.1.jar
 commons-fileupload-1.1.1.jar
 commons-io-1.4.jar
 commons-logging-1.0.4.jar
 commons-validator-1.3.0.jar
 freemarker-2.3.8.jar
 mail.jar
 ognl-2.6.11.jar
 oro-2.0.8.jar
 ostermillerutils_1_06_01.jar
 struts2-core-2.0.12.jar
 xwork-2.0.6.jar
 

Re: Struts 2 In Action Sample Application

2009-02-03 Thread SanJ.SANJAY

I actually do not have in WEB-INF/lib, I have all the jars in a shred lib and
add them in Eclipse and build. This is how I do for other projects also. 



Wes Wannemacher wrote:
 
 On Tuesday 03 February 2009 15:11:06 SanJ.SANJAY wrote:
 Even if I use the top content form your applicationContext.xml in chapter
 4, I get the same error..so wondering what else could eb the issue.
 
 Do you have multiple versions of Spring, or anything else that might
 attempt 
 to parse XML in your classpath (/WEB-INF/lib, common/lib, etc.) ?
 
 -Wes
 
 -- 
 
 Wes Wannemacher
 Author - Struts 2 In Practice 
 Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
 http://www.manning.com/wannemacher
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Struts-2-In-Action-Sample-Application-tp21798278p21818169.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: [S2] Ajax Anchor Tag

2009-02-03 Thread Wes Wannemacher
On Tuesday 03 February 2009 14:48:54 you wrote:
  That is what I had hoped for.  Unfortunately, it appears that the formId
 property is only considered when using the ajax theme.

 Thanks,
 Ken


Oh, I guess I misunderstood the question. There is no struts-y way to do it, 
other than using the AJAX theme. The best bet will be to link your href to a 
javascript function that builds the link based on the values of the form 
inputs and then go to it. To make it easier on yourself, specify the id values 
of your inputs, so that you can grab them (of course, you could iterate your 
form, too). 

-Wes


-- 

Wes Wannemacher
Author - Struts 2 In Practice 
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Problem moving from 2.0.14 to 2.1.6

2009-02-03 Thread Oleg T.
It eliminated the error, however, now field specific message defined
for the Model does not get displayed. I am still testing and will try
the same implementing ModelDriven.

Thanks, Oleg

On Mon, Jan 26, 2009 at 6:20 PM, Gustave Pheiffers
gpheiff...@pavtech.com wrote:
 Thanks Peter.

 That fixed the problem, although I didn't seem to need to implement 
 ModelDriven. I just added appendPrefix=false.

 Cheers
 Gus.


 -Original Message-
 From: dweebo [mailto:dwe...@pente.org]
 Sent: Tuesday, 27 January 2009 10:59 a.m.
 To: Struts Users Mailing List
 Subject: Re: Problem moving from 2.0.14 to 2.1.6


 I ran into the same issue, not from upgrading, just starting from scratch.

 I resolved the issue by:
 1. Making my action implement ModelDriven
 2. passing appendPrefix=false to visitorfieldvalidator

 For example, my action is
 MemberAction implements ModelDrivenMember {
public Member getModel() {
   return member;
}
...
@VisitorFieldValidator(appendPrefix=false, message=)
public Member getMember() {
   return member;
}
 }
 then inside Member.java I have all my validation annotations and it
 works fine.

 Good luck!
 -Peter

 Oleg T. wrote:
 Thanks Gus, you are correct that is the same exact case. I still have
 not found a work around other then passing an actually message with:

 @VisitorFieldValidator(message = Please )

 What worked with 2.0.x now does not:

 @VisitorFieldValidator(message = )


 Any other suggestions guys? Since Gus and I are the only ones seem to
 have this problem, I am wondering if anyone upgraded and was able to
 use VisitorFieldValidator without passing a message and without
 getting an error?

 Thanks, Oleg


 On Thu, Jan 22, 2009 at 11:56 AM, Gustave Pheiffers
 gpheiff...@pavtech.com wrote:

 Hi,

 I had the same problem. I didn't manage to fix the problem as I ran out of 
 time but I can tell you what I discovered which may help you.

 I found passing in a message e.g. @VisitorFieldValidator(message=Visitor) 
 stopped the exception you described from being thrown. However passing in a 
 message to the VisitorFieldValidator is not very useful but it was just 
 something I tried to try and narrow down the problem. When I removed the 
 VisitorFieldValidator the exception is still thrown as was the case for you.

 I realise this doesn't help you much but its as far as I got when looking 
 at the problem.

 If you have any luck in fixing the problem I would be interested in hearing 
 how you did it.

 Cheers
 Gus.



 -Original Message-
 From: Oleg T. [mailto:oleg...@gmail.com]
 Sent: Thursday, 22 January 2009 3:26 p.m.
 To: Struts Users Mailing List
 Subject: Problem moving from 2.0.14 to 2.1.6


 I am trying to upgrade to 2.1.6 and getting an error on Validation
 that I am having problems isolating. I followed migration guide at
 http://cwiki.apache.org/S2WIKI/troubleshooting-guide-migrating-from-struts-20x-to-21x.html
 and didn't actually have to change that much since application is in
 very beginning stages.

 The error I am getting is attached below and I am getting it from
 @VisitorFieldValidator, however even when I remove all validation
 annotations from that visitor object, the error still pops up, kind of
 lost here, any suggestions?



 Struts Problem Report

 Struts has detected an unhandled exception:
 Messages:
 File:   com/opensymphony/xwork2/util/TextParseUtil.java
 Line number:155
 Stacktraces
 java.lang.NullPointerException


 com.opensymphony.xwork2.util.TextParseUtil.translateVariables(TextParseUtil.java:155)

 com.opensymphony.xwork2.util.TextParseUtil.translateVariables(TextParseUtil.java:116)

 com.opensymphony.xwork2.util.TextParseUtil.translateVariables(TextParseUtil.java:38)

 com.opensymphony.xwork2.validator.validators.ValidatorSupport.getMessage(ValidatorSupport.java:99)

 com.opensymphony.xwork2.validator.validators.VisitorFieldValidator.validateObject(VisitorFieldValidator.java:156)

 com.opensymphony.xwork2.validator.validators.VisitorFieldValidator.validate(VisitorFieldValidator.java:130)

 com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValidatorManager.java:183)

 com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValidatorManager.java:94)

 com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValidatorManager.java:89)

 com.opensymphony.xwork2.validator.ValidationInterceptor.doBeforeInvocation(ValidationInterceptor.java:208)

 com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:247)

 org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)

 com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)

 

Setting up Struts for JSP application.

2009-02-03 Thread Son Nguyen
Hi,

I am completely new to struts.
I am having a hard time following some of the codes from the sample
struts application.
I have loaded the example mail reader and rest show case as well as some
of the other application.
They seem to be working with my tomcat 6.0 

Now I am trying to implant the struts framework to my application but
don't know where to start.
What I am trying to do is eventually have a filter that checks login
session after ever hit and to validate every field with a custom tag.

I will be working on creating a custom tag first.
So, I started by putting all the struts jar files into web-inf/lib.
Then I Put 
%@ taglib uri=/struts-tags prefix=s %
Into my login.jsp
My index.html points to login.jsp

Now I am confuse to what to do with the web.xml and struts.xml.
For some reason, after I place the taglib call, it won't return my
login.jsp.
I even restarted my tomcat.

Need help on the next step.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Display XMLGregorianCalendar as date on jsp page using type converter

2009-02-03 Thread Dave Newton

bilobag wrote:

I have a collection of XMLGregorianCalendar objects that I would like to
display on a jsp page as a formatted date.  So far I have tried creating my
own converter class to convert XMLGregorianCalendar to java.util.Date, but I
can't seem to get it called properly.  What is the best way to get this list
to display on a jsp page as formatted dates?  I didn't see much
documentation on how to create a converter to convert from one object type
to another.  Another option is for me to be able to call the
XMLGregorianCalendar methods on the jsp page like below, but that didn't
seem to work either.  Anybody know the answer?


s:iterator value=scheduleList status=scheduleStatus
  s:date value=scheduleList.toGregorianCalendar().getTime()
format=dd/MM//
/s:iterator


The type conversion stuff is for forms, not display, AFAIK.

If you're iterating over a list then wouldn't you want to call the 
conversion thing on each object of the iteration rather than on the list 
itself? (I don't know what your list class looks like, so I could be 
totally wrong.)


Dave


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Tag s:url

2009-02-03 Thread Moacyr Prado
Hi,

I`m using a tag url but this tag are not evaluate a expression
[0].getActionsName on action parameter.Is it normal?

example:

s:url var=myVar action=[0].getActionName()/
s:a href=%{myVar}s:property value=[0].getLinkText() /s:a/

The last Action called has getActionName() and getLinkText() methods.

In browser shows http://localhost/App/[0].getActionName[]

Can anybody help me?


Re: Tag s:url

2009-02-03 Thread Dave Newton

Moacyr Prado wrote:

I`m using a tag url but this tag are not evaluate a expression
[0].getActionsName on action parameter.Is it normal?

example:

s:url var=myVar action=[0].getActionName()/
s:a href=%{myVar}s:property value=[0].getLinkText() /s:a/

The last Action called has getActionName() and getLinkText() methods.

In browser shows http://localhost/App/[0].getActionName[]


I'm not sure that the action attribute is evaluated; there was a 
recent thread about this but I don't recall the outcome. You could 
always try to force evaluation via %{}.


Even if it's not evaluated, though, for future reference the OGNL 
expression could be noticeably shorter: actionName and linkText.


Dave


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Setting up Struts for JSP application.

2009-02-03 Thread Dave Newton

Son Nguyen wrote:

Hi,

I am completely new to struts.
I am having a hard time following some of the codes from the sample
struts application.
I have loaded the example mail reader and rest show case as well as some
of the other application.
They seem to be working with my tomcat 6.0 


Now I am trying to implant the struts framework to my application but
don't know where to start.
What I am trying to do is eventually have a filter that checks login
session after ever hit and to validate every field with a custom tag.

I will be working on creating a custom tag first.
So, I started by putting all the struts jar files into web-inf/lib.
Then I Put 
%@ taglib uri=/struts-tags prefix=s %

Into my login.jsp
My index.html points to login.jsp

Now I am confuse to what to do with the web.xml and struts.xml.
For some reason, after I place the taglib call, it won't return my
login.jsp.
I even restarted my tomcat.

Need help on the next step.


That's a pretty broad question.

Have you worked through the step-by-step tutorial on the Struts 2 
documentation wiki?


Dave


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: How to display composite listValue in listValue tag in Struts 2 without using iterator

2009-02-03 Thread Sonny Gill
Didn't you also post this at Javaranch
(http://www.coderanch.com/t/429374/Struts/show-composite-string-listValue-attribute)?

I answered it there, have a look.

Cheers,
S.

On Wed, Feb 4, 2009 at 2:58 AM, Saikat Podder
saikat.javafreak.pod...@gmail.com wrote:

 Hello Friends,


 I am new to Struts 2  I need your little help to clear a confusion.

 I want to display a Dropdown menu for Plans/Packages from a list of Plan
 object(List). The plan class has fields like id, name, price etc.

 so the code for the dropdown menu would be:



 lt;s:select list=plans label=Select Plan name=plan.id listKey=id
 listValue=name value=customer.plan.id /gt;



 But this only shows only the name of the plan(like basic, intermediate
 etc.) in the menu,  I want to show some additional info besides the name
 like basic : 5$/month, intermediate : 10$/month etc.) for that I need to
 use the price field of the Plan class also in the listValue expression.


 I have tried several expressions like listValue=name : price $/month or
 listValue=%{name} %{price} $/month but none of the works.


 So for now the only thing working for me is the normal html tag within an
 iterator.


 So is it really not possibly to display composite string as the value of
 listValue attribute of
  the select  tag? or am I missing something?

 Thanks in advance

 Saikat

 --
 View this message in context: 
 http://www.nabble.com/How-to-display-composite-listValue-in-listValue-tag-in-Struts-2-without-using-iterator-tp21816477p21816477.html
 Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Display XMLGregorianCalendar as date on jsp page using type converter

2009-02-03 Thread dusty

Here is a Calendar converter class.  Modify as necessary for your calendar
object:

import ognl.DefaultTypeConverter;
import org.apache.commons.lang.time.DateUtils;
import org.apache.commons.lang.time.FastDateFormat;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.text.ParseException;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Map;

/**
 */
public class CalendarConverter extends DefaultTypeConverter {
Log log = LogFactory.getLog(CalendarConverter.class);

public Object convertValue(Map map, Object object, Class aClass) {
/***Set
Standard Format*/
String[] parsePatterns = {
MM/dd/ hh:mm a,
MM/dd/ hh:mm:ss a,
dd-MMM- hh:mm a,
dd-MMM- hh:mm:ss a,
MM/dd/ HH:mm,
MM/dd/ HH:mm:ss,
dd-MMM- HH:mm,
dd-MMM- HH:mm:ss,
MM/dd/,
dd-MMM-
};
FastDateFormat df = FastDateFormat.getInstance(parsePatterns[0]);
if (aClass == Calendar.class) {
/Get
First Value in Parameters Array*/
String source = ((String[]) object)[0];
/Create
Target Calendar Object**/
Calendar returnCal = new GregorianCalendar();
Date transfer;
try {
   
/Call Commons
DateUtils parse with array of patterns*/
   
/Currently only one
pattern that forces the time to be*/
   
/present.  Could
include a MM/dd/ pattern but you*/
   
/should use a
java.util.Date object for that type*/
transfer = DateUtils.parseDate(source, parsePatterns);
returnCal = new GregorianCalendar();
returnCal.setTime(transfer);
return returnCal;
} catch (ParseException e) {
throw new RuntimeException(Cannot convert  + source +  to
calendar type);
}
} else if (aClass == String.class) {
Calendar o = (Calendar) object;
log.debug(o.getTime());
return df.format(o.getTime());
}
return null;
}
}


bilobag wrote:
 
 I have a collection of XMLGregorianCalendar objects that I would like to
 display on a jsp page as a formatted date.  So far I have tried creating
 my own converter class to convert XMLGregorianCalendar to java.util.Date,
 but I can't seem to get it called properly.  What is the best way to get
 this list to display on a jsp page as formatted dates?  I didn't see much
 documentation on how to create a converter to convert from one object type
 to another.  Another option is for me to be able to call the
 XMLGregorianCalendar methods on the jsp page like below, but that didn't
 seem to work either.  Anybody know the answer?
 
 
 s:iterator value=scheduleList status=scheduleStatus
   s:date value=scheduleList.toGregorianCalendar().getTime()
 format=dd/MM//
 /s:iterator
 

-- 
View this message in context: 
http://www.nabble.com/Display-XMLGregorianCalendar-as-date-on-jsp-page-using-type-converter-tp21821248p21824010.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: How to display composite listValue in listValue tag in Struts 2 without using iterator

2009-02-03 Thread Saikat Podder

Thank you Sonny,
It worked wonderfully  :) 
But apparently the same expression does not work for all types of
attributes.


Sonny Gill wrote:
 
 Didn't you also post this at Javaranch
 (http://www.coderanch.com/t/429374/Struts/show-composite-string-listValue-attribute)?
 
 I answered it there, have a look.
 
 Cheers,
 S.
 
 On Wed, Feb 4, 2009 at 2:58 AM, Saikat Podder
 saikat.javafreak.pod...@gmail.com wrote:

 Hello Friends,


 I am new to Struts 2  I need your little help to clear a confusion.

 I want to display a Dropdown menu for Plans/Packages from a list of Plan
 object(List). The plan class has fields like id, name, price etc.

 so the code for the dropdown menu would be:



 lt;s:select list=plans label=Select Plan name=plan.id listKey=id
 listValue=name value=customer.plan.id /gt;



 But this only shows only the name of the plan(like basic,
 intermediate
 etc.) in the menu,  I want to show some additional info besides the name
 like basic : 5$/month, intermediate : 10$/month etc.) for that I need
 to
 use the price field of the Plan class also in the listValue expression.


 I have tried several expressions like listValue=name : price $/month or
 listValue=%{name} %{price} $/month but none of the works.


 So for now the only thing working for me is the normal html tag within an
 iterator.


 So is it really not possibly to display composite string as the value of
 listValue attribute of
  the select  tag? or am I missing something?

 Thanks in advance

 Saikat

 --
 View this message in context:
 http://www.nabble.com/How-to-display-composite-listValue-in-listValue-tag-in-Struts-2-without-using-iterator-tp21816477p21816477.html
 Sent from the Struts - User mailing list archive at Nabble.com.

 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/How-to-show-composite-string-for-listValue-attribute-in-select-tag-in-Struts2-without-using-iterator-tp21816477p21825455.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



one bean between actions

2009-02-03 Thread Anton Bashmakov
Hi,
I Use struts 2 for my application. And I need to use the same bean in
different actions and JSPs. Like user has found an object we show him
details page, than he is able to edit the object, it's another JSPs but
object is the same (in this case there is even no action class between these
two views). Is there a way to do this without using session?

-- 
Best regards,
Bashmaкov Anton