servlet null when integrating with spring

2007-02-21 Thread anoe

Hi, i am integrating my struts based app with spring, and have a weird
problem, when configuring the controller to be
org.springframework.web.struts.DelegatingRequestProcessor in order to manage
my Action classes as spring beans, i can no more access the servlet
attribute from my Action classes (it's null). Is this normal, and, in that
case, which is the solution?

tx in advance.
-- 
View this message in context: 
http://www.nabble.com/servlet-null-when-integrating-with-spring-tf3266155.html#a9079246
Sent from the Struts - User mailing list archive at Nabble.com.


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



FileUpload problem

2007-02-21 Thread Nagraj Rao
Hi 

I've recently upgraded my app to work with Struts 2.0.5. Sometimes i'm getting 
this problem, specially when i try to upload 2 or more files concurrently

java.lang.RuntimeException: Unable to load bean 
org.apache.struts2.dispatcher.multipart.MultiPartRequest () - [unknown location]
 
com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:136)
 
com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:473)
 
com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:483)
 com.opensymphony.xwork2.inject.ContainerImpl$9.call(ContainerImpl.java:514)
 
com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:539)
 
com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:512)
 org.apache.struts2.dispatcher.Dispatcher.wrapRequest(Dispatcher.java:701)
 
org.apache.struts2.dispatcher.FilterDispatcher.prepareDispatcherAndWrapRequest(FilterDispatcher.java:327)
 
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:390)

Any insights would be helpfull.

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

Fw: FileUpload problem

2007-02-21 Thread Nagraj Rao
Also i think i'm using the right set of dependencies
commons-io-1.3.1
commons-collection 3.2
commons-fileupload-1.1.1

- Original Message - 
From: Nagraj Rao 
To: Struts Users Mailing List 
Sent: Wednesday, February 21, 2007 5:04 PM
Subject: FileUpload problem 


Hi 

I've recently upgraded my app to work with Struts 2.0.5. Sometimes i'm getting 
this problem, specially when i try to upload 2 or more files concurrently

java.lang.RuntimeException: Unable to load bean 
org.apache.struts2.dispatcher.multipart.MultiPartRequest () - [unknown location]
 
com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:136)
 
com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:473)
 
com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:483)
 com.opensymphony.xwork2.inject.ContainerImpl$9.call(ContainerImpl.java:514)
 
com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:539)
 
com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:512)
 org.apache.struts2.dispatcher.Dispatcher.wrapRequest(Dispatcher.java:701)
 
org.apache.struts2.dispatcher.FilterDispatcher.prepareDispatcherAndWrapRequest(FilterDispatcher.java:327)
 
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:390)

Any insights would be helpfull.

thanks  regards,
Nagraj

Issues running Struts 2.0.6 on Resin 3.0.21

2007-02-21 Thread mraible

I get the following error when I try to deploy a Struts 2.0.6 application on
Resin 3.0.21:

java.lang.NullPointerException
at
org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:50)
at _jsp._error__jsp._jspService(common/messages.jsp:2)

From this, it looks like messages.jsp is causing the problem.  In that file,
I have:

%-- ActionError Messages - usually set in Actions --%
s:if test=hasActionErrors()
div class=error id=errorMessages
  s:iterator value=actionErrors
 c:url value= 
alt=fmt:message key=icon.warning/ class=icon /
s:property escape=false/br /
  /s:iterator
   /div
/s:if

%-- FieldError Messages - usually set by validation rules --%
s:if test=hasFieldErrors()
div class=error id=errorMessages
  s:iterator value=fieldErrors
  s:iterator value=value
 c:url value= 
alt=fmt:message key=icon.warning/ class=icon /
 s:property escape=false/br /
  /s:iterator
  /s:iterator
   /div
/s:if

%-- Success Messages --%
c:if test=${not empty messages}
div class=message id=successMessages
c:forEach var=msg items=${messages}
 c:url value= 
alt=fmt:message key=icon.information/ class=icon /
c:out value=${msg} escapeXml=false/br /
/c:forEach
/div
c:remove var=messages scope=session/
/c:if

If I delete the contents of this file, I get:

[09:31:25.218] Compiling _jsp/_error__jsp.java
[09:31:25.791] java.lang.NullPointerException
[09:31:25.791]  at
org.springframework.web.context.request.RequestContextListener.requestDestroyed(RequestContextListener.java:67)

If I remove RequestContextListener from my web.xml, everything works great. 
This same application deploys and works fine on Tomcat.  Any ideas?  My
guess is there's something in messages.jsp that I need to fix.

Thanks,

Matt
-- 
View this message in context: 
http://www.nabble.com/Issues-running-Struts-2.0.6-on-Resin-3.0.21-tf3267060.html#a9081864
Sent from the Struts - User mailing list archive at Nabble.com.


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



struts2 validation for only one method in action

2007-02-21 Thread ros

Hi!

How to configure struts2 validation for only one method in action?

Thanks.
-- 
View this message in context: 
http://www.nabble.com/struts2-validation-for-only-one-method-in-action-tf3267302.html#a9082687
Sent from the Struts - User mailing list archive at Nabble.com.


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



client side validation on included form

2007-02-21 Thread C. Adams

I have a form that I access via an action on an ajax-ish page. (Form and
results are on same page) It's working great, but I can't figure out the
validation.

The page looks like this now:

s:div theme=ajax href=PersonByAge_input.action executeScripts=true /
s:div id=resultBox theme=ajax  /

with the form looking like this:

s:form action=PersonByAge theme=css_xhtml validate=true
   Betweenbr/
   s:textfield  name=startYear  label=Years labelposition=top  /
   br clear=left/andbr/
   s:textfield name=endYear label=Years labelposition=top /
   br clear=left/
   s:submit value=Find People theme=ajax targets=resultBox/
/s:form


With validation false, it works great.

With validation true, I get an error ReferenceError:
validateForm_PersonByAge is not defined and when I look in the generated
source, there are no javascript validation methods in the source.

but if I access the PersonByAge_input.action directly, the validation
methods are there in the source.

Have I hit a not quite ready area of the ajax theme?

Thanks.


Re: [S2] struts2 validation for only one method in action

2007-02-21 Thread cilquirm

I believe you can use validation annotation to specify validation routines at
the method level.




ros wrote:
 
 Hi!
 
 How to configure struts2 validation for only one method in action?
 
 Thanks.
 

-- 
View this message in context: 
http://www.nabble.com/struts2-validation-for-only-one-method-in-action-tf3267302.html#a9083597
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: [S2] struts2 validation for only one method in action

2007-02-21 Thread Musachy Barroso

See here:

http://struts.apache.org/2.x/docs/validation.html

you can add a file ActionName-MethodName-validation.xml with the validation
for that method.

regards
musachy

On 2/21/07, cilquirm [EMAIL PROTECTED] wrote:



I believe you can use validation annotation to specify validation routines
at
the method level.




ros wrote:

 Hi!

 How to configure struts2 validation for only one method in action?

 Thanks.


--
View this message in context:
http://www.nabble.com/struts2-validation-for-only-one-method-in-action-tf3267302.html#a9083597
Sent from the Struts - User mailing list archive at Nabble.com.


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





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


Re: [S2] struts2 validation for only one method in action

2007-02-21 Thread André Faria

Ok, but what about annotations without xmls?

Musachy Barroso escreveu:

See here:

http://struts.apache.org/2.x/docs/validation.html

you can add a file ActionName-MethodName-validation.xml with the 
validation

for that method.

regards
musachy

On 2/21/07, cilquirm [EMAIL PROTECTED] wrote:



I believe you can use validation annotation to specify validation 
routines

at
the method level.




ros wrote:

 Hi!

 How to configure struts2 validation for only one method in action?

 Thanks.


--
View this message in context:
http://www.nabble.com/struts2-validation-for-only-one-method-in-action-tf3267302.html#a9083597 


Sent from the Struts - User mailing list archive at Nabble.com.


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








--
Atenciosamente,
*/André Faria/*
/Bluesoft Consultoria em Informática/
/Fone: [55 11] 5543-5406/
/e-mail: [EMAIL PROTECTED]/
/Web: www.bluesoft.com.br/


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



Re: Usage of Struts - Tiles using tile controllers (Please help asi couldn't find enough documentation on it)

2007-02-21 Thread sriharsha . chevuru
If you can post some demo, that would be of great help Ray. Basically, i 
am trying to use tiles action or tiles controller. I would wait for your 
reply on this.

Thanks again.
Sri 
[EMAIL PROTECTED]



Ray Clough [EMAIL PROTECTED] 
02/20/2007 08:04 PM

Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org
cc

Subject
Re: Usage of Struts - Tiles using tile controllers (Please help asi 
couldn't find enough documentation on it)






Sri,
]
If you're still having problems with Tiles in Struts 1.x, I have a demo 
app I used for a Struts class at UCLA Extension.  It has lots of things 
going on besides Tiles, but I use Tiles exclusively for all pages, and 
it is fairly easy to follow.  If you or anyone would like it, I'd be 
happy to post it somewhere and you can have at it.  There are a number 
of ways of using Tiles, but the only way which makes sense to me is to 
declare screens in a centralized xml file and to have the action results 
call the tiles screens instead of raw jsp.  Another thing the app does 
is to use 'jspx' format docs instead of 'jsp' pages.  The use of jspx 
(Sun calls them 'jsp documents') seems to me like a big improvement over 
jsp, and there are equivalent jsp and jspx pages for everything.

- Ray Clough
[EMAIL PROTECTED]



[EMAIL PROTECTED] wrote:
 Hi,

 I trying to implement Tile Controllers concept in Struts 1.3.5 and i 
am 
 not able to find enough documentation like any sample examples, etc. 
about 
 it. Can any of you please direct towards a resource which has some 
sample 
 applications using tile controllers.

 Thank you
 Sri
 

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


ForwardSourceID:NT36B2 


Re: [S2] struts2 validation for only one method in action

2007-02-21 Thread ros

I assume for action:
public class TicketAction extends com.opensymphony.xwork2.ActionSupport {
...
 public string save() {
...
 }
...
}
the file name should be  TicketAction-save-validation.xml ???

File with such name is ignored on form submit.

Only TicketAction-validation.xml is valid file name.

Any ideas, why?

If I have in one form DELETE and SAVE buttons, how to turn off client side
validation for DELETE button?

Thanks.


Musachy Barroso wrote:
 
 See here:
 
 http://struts.apache.org/2.x/docs/validation.html
 
 you can add a file ActionName-MethodName-validation.xml with the
 validation
 for that method.
 
 regards
 musachy
 
 On 2/21/07, cilquirm [EMAIL PROTECTED] wrote:


 I believe you can use validation annotation to specify validation
 routines
 at
 the method level.




 ros wrote:
 
  Hi!
 
  How to configure struts2 validation for only one method in action?
 
  Thanks.
 

 --
 View this message in context:
 http://www.nabble.com/struts2-validation-for-only-one-method-in-action-tf3267302.html#a9083597
 Sent from the Struts - User mailing list archive at Nabble.com.


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


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

-- 
View this message in context: 
http://www.nabble.com/struts2-validation-for-only-one-method-in-action-tf3267302.html#a9085071
Sent from the Struts - User mailing list archive at Nabble.com.


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



Please Help: Problem in implementing Tiles Controller

2007-02-21 Thread sriharsha . chevuru
__


Hi Dave,

Thanks for pointing me towards the link, it was of great help. Here is
what i did. And i am also pasting the error i am getting.

Step1: I created the following definition in my tiles-defs.xml

tiles-defs.xml

tiles-definitions
definition name=base.page path=/pages/entCounsTileLayout.jsp
put name=header value=/pages/entCslHeader.jsp /
put name=contact value=/pages/contact.jsp /
put name=footer value=/pages/seminarFooter.jsp /
/definition

definition name=question1.page extends=base.page
put name=body value=.question1Body.page /
/definition
definition name=.question1Body.page path=/pages/question1Body.jsp
controllerClass=com.wef.seminar.entrance.QuestionController
/definition
/tiles-definitions


Step2: I have the code of the controller i wrote, i have the package
specific code and import statements intact:

public class QuestionController implements Controller {

public void execute(ComponentContext context, HttpServletRequest
request,
HttpServletResponse response, ServletContext
servContext) throws Exception {
}

public void perform(ComponentContext context, HttpServletRequest
request,
HttpServletResponse response, ServletContext
servContext)
throws ServletException, IOException {
java.util.ArrayList q1Choice = null;
com.wef.seminar.entrance.EntranceAnswers ans = new
com.wef.seminar.entrance.EntranceAnswers();
q1Choice = ans.getQ1ChoiceList();

System.out.println(\nI am
here***\n);
request.setAttribute(q1Choice, q1Choice);
request.setAttribute(vartest,Ajay Shenoy);
System.out.println(\nI end
here***\n);
}

}

Step3: Here is the code of jsp, i.e. question1Body.jsp as mentioned in the
tiles-defs.xml in the directory pages.

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN

%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
%@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean %
%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %
%@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles %

html:html
HEAD
%@ page language=java contentType=text/html;
charset=ISO-8859-1
pageEncoding=ISO-8859-1 import=java.util.Enumeration%
META http-equiv=Content-Type content=text/html;
charset=ISO-8859-1
META name=GENERATOR content=IBM Software Development Platform

META http-equiv=Content-Style-Type content=text/css
LINK href=theme/elstylesheet.css rel=stylesheet type=
text/css
TITLE/TITLE
html:javascript formName=AnswerForm /
/HEAD
BODY
html:form action=/question1Action onsubmit=return
validateAnswerForm(this)

tiles:useAttribute name=q1Choice id=
q1Choice classname=java.util.ArrayList scope=request/
logic:iterate id=row name=
q1Choice
html:radio property=
answer value=value idName=row/
bean:write name=row
property=label/
BR
/logic:iterate

BR
html:hidden property=
QuestionNumber value=Question1/
html:submit property=submit
value=Continue /


/html:form
/BODY
/html:html

Step4: Here is the error i am getting:

Feb 20, 2007 2:42:40 PM org.apache.catalina.core.ApplicationDispatcher
invoke
SEVERE: Servlet.service() for servlet jsp threw exception
javax.servlet.jsp.JspException: Error - tag useAttribute : attribute
'q1Choice' not found in context. Check tag syntax
at org.apache.struts.tiles.taglib.UseAttributeTag.doStartTag(
UseAttributeTag.java:182)
at org.apache.jsp.pages.question1Body_jsp._jspService(
question1Body_jsp.java:223)
at org.apache.jasper.runtime.HttpJspBase.service(
HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(
JspServletWrapper.java:334)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(
JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(
JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(
ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(
ApplicationDispatcher.java:574)
at org.apache.catalina.core.ApplicationDispatcher.include(
ApplicationDispatcher.java:499)
at org.apache.jasper.runtime.JspRuntimeLibrary.include(
JspRuntimeLibrary.java:966)
at org.apache.jasper.runtime.PageContextImpl.doInclude(
PageContextImpl.java:631)
at org.apache.jasper.runtime.PageContextImpl.include(
PageContextImpl.java:625)
at sun.reflect.GeneratedMethodAccessor241.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.struts.tiles.TilesUtilImpl.doInclude(
TilesUtilImpl.java:126)
at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:149)
at org.apache.struts.tiles.taglib.InsertTag.doInclude(
InsertTag.java:761)
at
org.apache.struts.tiles.taglib.InsertTag$InsertHandler.doEndTag(

Re: [S2] struts2 validation for only one method in action

2007-02-21 Thread ros

Java Script validation fro button disabled by 

s:submit cssClass=button method=delete key=button.delete
   
onclick=document.getElementById('ticketForm').onsubmit = null; /


ros wrote:
 
 If I have in one form DELETE and SAVE buttons, how to turn off client side
 validation for DELETE button?
 

-- 
View this message in context: 
http://www.nabble.com/struts2-validation-for-only-one-method-in-action-tf3267302.html#a9086501
Sent from the Struts - User mailing list archive at Nabble.com.


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



Validate phone question 1.2.9

2007-02-21 Thread Jim Reynolds

Best way to validate a phone that has 3 textfields.

Scope wants 3 textfields (areacode, phoneexchange, phone4) on a form.
We need to validate that the phone has all digits in each of the
fields. But upon looking at the docs, I do not see a clean way to
handle this.

I am sure this is done often, and possibly there is a recipe somewhere
for this. Using the validator framework.

Thanks,

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



Tomcat locks jars after undeploying web application

2007-02-21 Thread Juan Espinosa

Hi to all im having problems with tomcat and windows. The struts2-core jar
get locked when i do an undeploy of my web application. I found that in
tomcat you can put a property to avoid lock of jars…also i found a lot of
posts that say that this property is not working…

Anyone has fight with issue ??? Any advice is welcome….



I copy this from tomcat web site

want to redeploy web applications, how do I prevent resources from getting
locked? 

Most locking issues will occur with JARs from /WEB-INF/lib, and are useally
caused by access through URLs. Tomcat has mechanisms to allow avoiding
locking. In Tomcat 5.0, a mechanism exists to prevent locking when accessing
resources using the getResource method of the URL classloader (many
applications, such as Xerces, do not set the use of caching to false before
opening the URL connection, causing locking). If such a call occurs,
resources inside the JARs will be extracted to the work directory of the web
application. In Tomcat 5.5, this mechanism is disabled by default (as it has
a non negligible influence on startup times, and is often useless), and can
be enabled using the antiJARLocking attribute of the Context element. There
is another lock prevention mechanism in Tomcat 5.5 (antiResourceLocking
attribute), which will cause the web application files to be copied to the
temp folder and run from this location. This has a larger impact on web
application startup times, but obviously prevents locking on all resources
of the web application. This also allows more flexible management operations
as none of the web application resources will be locked, even while the web
application is running (as a special note, when making changes JSPs without
reloading the application, the changes has to be duplicated to the path
where the web application resources have been copied in the temp folder). 


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.441 / Virus Database: 268.18.3/694 - Release Date: 20/02/2007
13:44
 


Re: Validate phone question 1.2.9

2007-02-21 Thread Dave Newton
Regexp (mask) validator?

http://struts.apache.org/1.2.9/userGuide/dev_validator.html

--- Jim Reynolds [EMAIL PROTECTED] wrote:

 Best way to validate a phone that has 3 textfields.
 
 Scope wants 3 textfields (areacode, phoneexchange,
 phone4) on a form.
 We need to validate that the phone has all digits in
 each of the
 fields. But upon looking at the docs, I do not see a
 clean way to
 handle this.
 
 I am sure this is done often, and possibly there is
 a recipe somewhere
 for this. Using the validator framework.
 
 Thanks,
 

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



 

Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives.
http://tools.search.yahoo.com/toolbar/features/mail/

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



Re: Validate phone question 1.2.9

2007-02-21 Thread Jim Reynolds

If I am reading you correctly, you are saying to use that for one
field. Which is actually what I just did.
EG:
global
   constant
 constant-namephone/constant-name
 constant-value^\(?(\d{3})\)?[-| ]?(\d{3})[-| ]?(\d{4})$/constant-value
   /constant

but the client wants to see 3 textfield boxes separated with hyphens,
etc. So that is where I ran into issues. I was trying to ensure that
textfield1 had 3 digits, then textfield2 had 3 digits and then
textfield3 had 4 digits.

something the client wants. I did fall back to one textfield curently
to move forward. I guess I could write my own validator and be done.

Thanks,


On 2/21/07, Dave Newton [EMAIL PROTECTED] wrote:

Regexp (mask) validator?

http://struts.apache.org/1.2.9/userGuide/dev_validator.html

--- Jim Reynolds [EMAIL PROTECTED] wrote:

 Best way to validate a phone that has 3 textfields.

 Scope wants 3 textfields (areacode, phoneexchange,
 phone4) on a form.
 We need to validate that the phone has all digits in
 each of the
 fields. But upon looking at the docs, I do not see a
 clean way to
 handle this.

 I am sure this is done often, and possibly there is
 a recipe somewhere
 for this. Using the validator framework.

 Thanks,


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







Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives.
http://tools.search.yahoo.com/toolbar/features/mail/

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




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



Re: Validate phone question 1.2.9

2007-02-21 Thread Dave Newton
So... define three regexps? (Well, two, but you know
what I mean :)

--- Jim Reynolds [EMAIL PROTECTED] wrote:

 If I am reading you correctly, you are saying to use
 that for one
 field. Which is actually what I just did.
 EG:
 global
 constant
   constant-namephone/constant-name
   constant-value^\(?(\d{3})\)?[-| ]?(\d{3})[-|
 ]?(\d{4})$/constant-value
 /constant
 
 but the client wants to see 3 textfield boxes
 separated with hyphens,
 etc. So that is where I ran into issues. I was
 trying to ensure that
 textfield1 had 3 digits, then textfield2 had 3
 digits and then
 textfield3 had 4 digits.
 
 something the client wants. I did fall back to one
 textfield curently
 to move forward. I guess I could write my own
 validator and be done.
 
 Thanks,
 
 
 On 2/21/07, Dave Newton [EMAIL PROTECTED]
 wrote:
  Regexp (mask) validator?
 
 

http://struts.apache.org/1.2.9/userGuide/dev_validator.html
 
  --- Jim Reynolds [EMAIL PROTECTED] wrote:
 
   Best way to validate a phone that has 3
 textfields.
  
   Scope wants 3 textfields (areacode,
 phoneexchange,
   phone4) on a form.
   We need to validate that the phone has all
 digits in
   each of the
   fields. But upon looking at the docs, I do not
 see a
   clean way to
   handle this.
  
   I am sure this is done often, and possibly there
 is
   a recipe somewhere
   for this. Using the validator framework.
  
   Thanks,
  
  
 

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


  Never miss an email again!
  Yahoo! Toolbar alerts you the instant new Mail
 arrives.
 
 http://tools.search.yahoo.com/toolbar/features/mail/
 
 

-
  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]
 
 



 

Food fight? Enjoy some healthy debate 
in the Yahoo! Answers Food  Drink QA.
http://answers.yahoo.com/dir/?link=listsid=396545367

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



Problem with action tag - Bug in result handling for actions rendered with

2007-02-21 Thread Rich Thornett

I am using the action tag
-- 
View this message in context: 
http://www.nabble.com/Problem-with-action-tag---Bug-in-result-handling-for-actions-rendered-with-tf3268979.html#a9088100
Sent from the Struts - User mailing list archive at Nabble.com.


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



[S2] configuring velocity toolbox

2007-02-21 Thread bob

I'm trying to use the velocity toolbox with struts2.  It seems that there some 
problem getting the velocity toolbox configured.  None of the tools I configure 
in the toolbox.xml file are available in the velocity templates.  

The wierd thing is that the output from the velocity servlet init code claims 
that is is getting setup just fine, see below.  However, I've changed XHTML 
element to false in my toolbox.xml and this log still says true?  Obviously, my 
toolbox.xml isn't getting processed.  And I do have it in the location that it 
specifies below.  
  

INFO:  Velocity   [info] Velocity successfully started.
Feb 21, 2007 6:11:50 AM 
org.apache.velocity.tools.view.servlet.ServletToolboxManager getInstance
INFO: Using config file '/WEB-INF/toolbox.xml'
Feb 21, 2007 6:11:50 AM 
org.apache.velocity.tools.view.servlet.ServletToolboxManager setXhtml
INFO: XHTML is set to true
Feb 21, 2007 6:11:50 AM 
org.apache.velocity.tools.view.servlet.ServletToolboxManager getInstance
INFO: Toolbox setup complete.





___
Join Excite! - http://www.excite.com
The most personalized portal on the Web!



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



struts2-blank-2.0.6.war doesn´t work ?

2007-02-21 Thread Pedro Herrera

I´ve moved struts2-blank-2.0.6.war to my deploy location in jboss(405) to see
struts2 working but 

it doesn´t work. Anybody has tested this ??


Tks 

Herrera
 

-- 
View this message in context: 
http://www.nabble.com/struts2-blank-2.0.6.war-doesn%C2%B4t-work---tf3269121.html#a9088618
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: struts2-blank-2.0.6.war doesn´t work ?

2007-02-21 Thread Ted Husted

It works for me. Are you sure there isn't another issue?

On 2/21/07, Pedro Herrera [EMAIL PROTECTED] wrote:


I´ve moved struts2-blank-2.0.6.war to my deploy location in jboss(405) to see
struts2 working but 

it doesn´t work. Anybody has tested this ??


Tks 

Herrera


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



Re: [S2] struts2-blank-2.0.6.war doesn´t work ?

2007-02-21 Thread Pedro Herrera

I´m so sorry !!!  I´ve made a new installation of jboss, and  the blank
application works fine !!

Herrera



husted wrote:
 
 It works for me. Are you sure there isn't another issue?
 
 On 2/21/07, Pedro Herrera [EMAIL PROTECTED] wrote:

 I´ve moved struts2-blank-2.0.6.war to my deploy location in jboss(405) to
 see
 struts2 working but 

 it doesn´t work. Anybody has tested this ??


 Tks 

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

-- 
View this message in context: 
http://www.nabble.com/struts2-blank-2.0.6.war-doesn%C2%B4t-work---tf3269121.html#a9089556
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: Please Help: Problem in implementing Tiles Controller

2007-02-21 Thread Strachan, Paul
I can't see q1Choice defined in your tiles, it looks like you have
defined the attribute only on request scope.

header,contact,footer are tiles attributes - just comment out the
tiles:useAttribute.../ and you might be OK.


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 
Sent: Thursday, 22 February 2007 5:17 AM
To: Struts Users Mailing List
Subject: Please Help: Problem in implementing Tiles Controller

__


Hi Dave,

Thanks for pointing me towards the link, it was of great help. Here is
what i did. And i am also pasting the error i am getting.

Step1: I created the following definition in my tiles-defs.xml

tiles-defs.xml

tiles-definitions
definition name=base.page path=/pages/entCounsTileLayout.jsp
put name=header value=/pages/entCslHeader.jsp /
put name=contact value=/pages/contact.jsp /
put name=footer value=/pages/seminarFooter.jsp /
/definition

definition name=question1.page extends=base.page
put name=body value=.question1Body.page /
/definition
definition name=.question1Body.page path=/pages/question1Body.jsp
controllerClass=com.wef.seminar.entrance.QuestionController
/definition
/tiles-definitions


Step2: I have the code of the controller i wrote, i have the package
specific code and import statements intact:

public class QuestionController implements Controller {

public void execute(ComponentContext context, HttpServletRequest
request,
HttpServletResponse response, ServletContext
servContext) throws Exception {
}

public void perform(ComponentContext context, HttpServletRequest
request,
HttpServletResponse response, ServletContext
servContext)
throws ServletException, IOException {
java.util.ArrayList q1Choice = null;
com.wef.seminar.entrance.EntranceAnswers ans = new
com.wef.seminar.entrance.EntranceAnswers();
q1Choice = ans.getQ1ChoiceList();

System.out.println(\nI am
here***\n);
request.setAttribute(q1Choice, q1Choice);
request.setAttribute(vartest,Ajay Shenoy);
System.out.println(\nI end
here***\n);
}

}

Step3: Here is the code of jsp, i.e. question1Body.jsp as mentioned in
the
tiles-defs.xml in the directory pages.

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN

%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
%@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean %
%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %
%@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles %

html:html
HEAD
%@ page language=java contentType=text/html;
charset=ISO-8859-1
pageEncoding=ISO-8859-1 import=java.util.Enumeration%
META http-equiv=Content-Type content=text/html;
charset=ISO-8859-1
META name=GENERATOR content=IBM Software Development Platform

META http-equiv=Content-Style-Type content=text/css
LINK href=theme/elstylesheet.css rel=stylesheet type=
text/css
TITLE/TITLE
html:javascript formName=AnswerForm /
/HEAD
BODY
html:form action=/question1Action onsubmit=return
validateAnswerForm(this)

tiles:useAttribute name=q1Choice id=
q1Choice classname=java.util.ArrayList scope=request/
logic:iterate id=row name=
q1Choice
html:radio property=
answer value=value idName=row/
bean:write name=row
property=label/
BR
/logic:iterate

BR
html:hidden property=
QuestionNumber value=Question1/
html:submit property=submit
value=Continue /


/html:form
/BODY
/html:html

Step4: Here is the error i am getting:

Feb 20, 2007 2:42:40 PM org.apache.catalina.core.ApplicationDispatcher
invoke
SEVERE: Servlet.service() for servlet jsp threw exception
javax.servlet.jsp.JspException: Error - tag useAttribute : attribute
'q1Choice' not found in context. Check tag syntax
at org.apache.struts.tiles.taglib.UseAttributeTag.doStartTag(
UseAttributeTag.java:182)
at org.apache.jsp.pages.question1Body_jsp._jspService(
question1Body_jsp.java:223)
at org.apache.jasper.runtime.HttpJspBase.service(
HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(
JspServletWrapper.java:334)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(
JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(
JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(
ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(
ApplicationDispatcher.java:574)
at org.apache.catalina.core.ApplicationDispatcher.include(
ApplicationDispatcher.java:499)
at org.apache.jasper.runtime.JspRuntimeLibrary.include(
JspRuntimeLibrary.java:966)
at org.apache.jasper.runtime.PageContextImpl.doInclude(
PageContextImpl.java:631)
at org.apache.jasper.runtime.PageContextImpl.include(
PageContextImpl.java:625)
at sun.reflect.GeneratedMethodAccessor241.invoke(Unknown Source)

Nested tags confusion

2007-02-21 Thread David Miller

Greetings.

I'm having extreme difficulty getting my application to work with nested
tags.

My form is very simple: it consists of a string and a DTO Object. The DTO
Object in turn contains a List that holds another DTO Object: Form - Bean
- List.
Currently I can display data with no trouble but updating data does not
work. I get a variety of very informative errors but and occasionally get no
errors at all. In either case, I am not able to retrieve any updated data in
my Action.

My guess is that I need something to help Struts auto-populate the form. I'm
very new to Struts though so all of this is still pretty mysterious.

Additionally I'm stuck with Struts 1.1x and am unable to update/change/add
any jars.

code:

*The Form*
public class UserInfoForm extends ActionForm
{
private String callType;
private UserInfoDTO userInfoDTO = new UserInfoDTO();

public UsocMaintenanceForm() {
 super();
}

public UserInfoDTO getUsocMaintenanceDTO() {
 return userInfoDTO;
}

public void setUserInfoDTO(UserInfoDTO userInfoDTO) {
 this.userInfoDTO = userInfoDTO;
}

public void setCallType(String callType) {
 this.callType = callType;
}

public String getCallType() {
 return callType;
}
}

*UserInfoDTO*
public class UserInfoDTO
{
 private String userName;
 private List gadgetList;

 public UserInfoDTO() {
 }

 public String getUserName() {
   return userName;
 }

 public void setUserName(List gadgetList) {
   this.gadgetList= gadgetList;
 }

 public List getGadgetList() {
   return gadgetList;
 }

 public void setGadgetList(String userName) {
   this.userName = userName;
 }

 public GadgetDTO getCreateGadgetDTO( int index )
 {
while( gadgetList.size() = index )
{
 gadgetList.add( new GadgetDTO() );
}

return (GadgetDTO)gadgetList.get( index );
 }
}

*GadgetDTO
*public class GadgetDTO
{
private String description;
private String cost;

public String getDescription() {
  return description;
}

public void setDescription( String description ) {
  this.description = description;
}

public void setCost( String cost ) {
  this.cost = cost;
}

public String getCost() {
  return cost;
}
}
*Part of the JSP*
html:form action=/gadgetAction.do
...
nested:nest property=userInfoDTO
 nested:iterate property=gadgetList type=com.foo.dto.GadgetDTO
id=createGadgetDTO
   tr
 tdnested:text name=createGadgetDTO property=description
indexed=true //td
   /tr
 tdnested:text name=createGadgetDTO property=cost indexed=true
//td
   tr
   /tr
 /nested:iterate
/nested:nest
...
%-- buttons --%
...
/html:form


Re: Nested tags confusion

2007-02-21 Thread Nuwan Chandrasoma

hi,

try remvoing the 'name' attribute from the nested text tasg.

eg: nested:text  property=description indexed=true /

Regards,

Nuwan.

- Original Message - 
From: David Miller [EMAIL PROTECTED]

To: user@struts.apache.org
Sent: Wednesday, February 21, 2007 11:39 PM
Subject: Nested tags confusion



Greetings.

I'm having extreme difficulty getting my application to work with nested
tags.

My form is very simple: it consists of a string and a DTO Object. The DTO
Object in turn contains a List that holds another DTO Object: Form - Bean
- List.
Currently I can display data with no trouble but updating data does not
work. I get a variety of very informative errors but and occasionally get 
no
errors at all. In either case, I am not able to retrieve any updated data 
in

my Action.

My guess is that I need something to help Struts auto-populate the form. 
I'm

very new to Struts though so all of this is still pretty mysterious.

Additionally I'm stuck with Struts 1.1x and am unable to update/change/add
any jars.

code:

*The Form*
public class UserInfoForm extends ActionForm
{
private String callType;
private UserInfoDTO userInfoDTO = new UserInfoDTO();

public UsocMaintenanceForm() {
 super();
}

public UserInfoDTO getUsocMaintenanceDTO() {
 return userInfoDTO;
}

public void setUserInfoDTO(UserInfoDTO userInfoDTO) {
 this.userInfoDTO = userInfoDTO;
}

public void setCallType(String callType) {
 this.callType = callType;
}

public String getCallType() {
 return callType;
}
}

*UserInfoDTO*
public class UserInfoDTO
{
 private String userName;
 private List gadgetList;

 public UserInfoDTO() {
 }

 public String getUserName() {
   return userName;
 }

 public void setUserName(List gadgetList) {
   this.gadgetList= gadgetList;
 }

 public List getGadgetList() {
   return gadgetList;
 }

 public void setGadgetList(String userName) {
   this.userName = userName;
 }

 public GadgetDTO getCreateGadgetDTO( int index )
 {
while( gadgetList.size() = index )
{
 gadgetList.add( new GadgetDTO() );
}

return (GadgetDTO)gadgetList.get( index );
 }
}

*GadgetDTO
*public class GadgetDTO
{
private String description;
private String cost;

public String getDescription() {
  return description;
}

public void setDescription( String description ) {
  this.description = description;
}

public void setCost( String cost ) {
  this.cost = cost;
}

public String getCost() {
  return cost;
}
}
*Part of the JSP*
html:form action=/gadgetAction.do
...
nested:nest property=userInfoDTO
 nested:iterate property=gadgetList type=com.foo.dto.GadgetDTO
id=createGadgetDTO
   tr
 tdnested:text name=createGadgetDTO property=description
indexed=true //td
   /tr
 tdnested:text name=createGadgetDTO property=cost 
indexed=true

//td
   tr
   /tr
 /nested:iterate
/nested:nest
...
%-- buttons --%
...
/html:form




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



Re: [S2] Issues running Struts 2.0.6 on Resin 3.0.21

2007-02-21 Thread mraible

This issue turned out to be a bug in Spring's RequestContextLoader and will
be fixed in Spring 2.0.3:

http://forum.springframework.org/showthread.php?t=33874

Matt


mraible wrote:
 
 I get the following error when I try to deploy a Struts 2.0.6 application
 on Resin 3.0.21:
 
 java.lang.NullPointerException
   at
 org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:50)
   at _jsp._error__jsp._jspService(common/messages.jsp:2)
 
 From this, it looks like messages.jsp is causing the problem.  In that
 file, I have:
 
 %-- ActionError Messages - usually set in Actions --%
 s:if test=hasActionErrors()
 div class=error id=errorMessages
   s:iterator value=actionErrors
  c:url value= 
 alt=fmt:message key=icon.warning/ class=icon /
 s:property escape=false/br /
   /s:iterator
/div
 /s:if
 
 %-- FieldError Messages - usually set by validation rules --%
 s:if test=hasFieldErrors()
 div class=error id=errorMessages
   s:iterator value=fieldErrors
   s:iterator value=value
  c:url value= 
 alt=fmt:message key=icon.warning/ class=icon /
  s:property escape=false/br /
   /s:iterator
   /s:iterator
/div
 /s:if
 
 %-- Success Messages --%
 c:if test=${not empty messages}
 div class=message id=successMessages
 c:forEach var=msg items=${messages}
  c:url value= 
 alt=fmt:message key=icon.information/ class=icon
 /
 c:out value=${msg} escapeXml=false/br /
 /c:forEach
 /div
 c:remove var=messages scope=session/
 /c:if
 
 If I delete the contents of this file, I get:
 
 [09:31:25.218] Compiling _jsp/_error__jsp.java
 [09:31:25.791] java.lang.NullPointerException
 [09:31:25.791]  at
 org.springframework.web.context.request.RequestContextListener.requestDestroyed(RequestContextListener.java:67)
 
 If I remove RequestContextListener from my web.xml, everything works
 great.  This same application deploys and works fine on Tomcat.  Any
 ideas?  My guess is there's something in messages.jsp that I need to fix.
 
 Thanks,
 
 Matt
 

-- 
View this message in context: 
http://www.nabble.com/Issues-running-Struts-2.0.6-on-Resin-3.0.21-tf3267060.html#a9094100
Sent from the Struts - User mailing list archive at Nabble.com.


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