Re: Custom Tags for Struts2

2009-03-16 Thread Beppe Catanese

I put together a simple HOW-TO based on my experience with a similar task:

http://bodez.wordpress.com/2009/03/13/customising-struts2-jsp-tags/

Ciao
Beppe



Varun Narang wrote:
 
 Hello all,
 I want to get started with the customzied tag writing for Struts2.
 I was able to find out ftl files for corresponding HTML elements.
 Actually, I want to start writing tags which are integrated with ExtJS
 library.
 I'd appreciate if some one could point me to some resource where I can
 find
 out the details of current flow of Struts-UI tag rendering.
 
 Thanks in advance.
 
 --
 Regards,
 Varun Narang.
 
 

-- 
View this message in context: 
http://www.nabble.com/Custom-Tags-for-Struts2-tp14289600p22533131.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



Unable to find interceptor class referenced by ref-name gwt

2009-03-16 Thread Stephan Schröder

When deploying my HelloWorld-struts2-gwt-application i get this exception:

SCHWERWIEGEND: Exception starting filter struts2
Unable to load configuration. - interceptor-ref -
file:/D:/Programme/eclipse/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/struts2gwt-helloworld/WEB-INF/classes/example.xml:15:39
at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
...
Caused by: Unable to find interceptor class referenced by ref-name gwt -
interceptor-ref -
file:/D:/Programme/eclipse/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/struts2gwt-helloworld/WEB-INF/classes/example.xml:15:39
at
com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:52)
...

The gwt-interceptor is referenced in example.xml:
action name=MessageService class=action.MessageServiceAction
method=getMessage
interceptor-ref name=gwt/
/action

The gwt-interceptor is present in the struts2gwtplugin-0.2.1.jar which is of
course added in WEB-INF/lib.
I haven't yet compiled the gwt-part to javascript, so the application won't
work as is, but the struts2-configuration should be loaded without problems.
Here is the code:
http://www.nabble.com/file/p22534621/struts2gwt-helloworld.war
struts2gwt-helloworld.war 

Regards,
Stephan
-- 
View this message in context: 
http://www.nabble.com/Unable-to-find-interceptor-class-referenced-by-ref-name-gwt-tp22534621p22534621.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



Fileupload : Restricted contentType is working fine but no proper error message is shown to user

2009-03-16 Thread sajidbigler

Hi,

Please help me to show error messages.when we restrict the contentTypes as
shown in the link

http://struts.apache.org/2.0.11.1/docs/file-upload-interceptor.html

The contents are restricted but the error wont be shown to end user how to
make it work please help me!


struts.xml


action name=MMSUpload

class=com.teleparadigm.mms.application.mms.MMSUploadAction
interceptor-ref name=i18n /
interceptor-ref name=fileUpload

image/png,image/gif,image/jpeg

/interceptor-ref
interceptor-ref name=basicStack /
interceptor-ref name=validation /
result name=input/pages/ComposeMMS.jsp/result
result name=error/pages/ComposeMMS.jsp/result
result/pages/upload_success.jsp/result
/action


Thanks,

Sajid
-- 
View this message in context: 
http://www.nabble.com/Fileupload-%3A-Restricted-contentType-is-working-fine-but-no-proper-error-message-is-shown-to-user-tp22535689p22535689.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: Fileupload : Restricted contentType is working fine but no proper error message is shown to user

2009-03-16 Thread ravindra
You have to mention param -allowed types.

interceptor-ref name=fileUpload
param
name=allowedTypesimage/png,image/gif,image/jpeg,text/plain/param
/interceptor-ref
/action

-Original Message-
From: sajidbigler [mailto:sajidbig...@gmail.com] 
Sent: Monday, March 16, 2009 4:23 PM
To: user@struts.apache.org
Subject: Fileupload : Restricted contentType is working fine but no proper
error message is shown to user


Hi,

Please help me to show error messages.when we restrict the contentTypes as
shown in the link

http://struts.apache.org/2.0.11.1/docs/file-upload-interceptor.html

The contents are restricted but the error wont be shown to end user how to
make it work please help me!


struts.xml


action name=MMSUpload

class=com.teleparadigm.mms.application.mms.MMSUploadAction
interceptor-ref name=i18n /
interceptor-ref name=fileUpload

image/png,image/gif,image/jpeg

/interceptor-ref
interceptor-ref name=basicStack /
interceptor-ref name=validation /
result name=input/pages/ComposeMMS.jsp/result
result name=error/pages/ComposeMMS.jsp/result
result/pages/upload_success.jsp/result
/action


Thanks,

Sajid
-- 
View this message in context:
http://www.nabble.com/Fileupload-%3A-Restricted-contentType-is-working-fine-
but-no-proper-error-message-is-shown-to-user-tp22535689p22535689.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





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



System.out into interceptor

2009-03-16 Thread PEGASUS84

excuse me!!!
how can I show in a jsp page the text which is into an interceptor


[snipp]

public String intercept(.

System.out.print(text)

[/snipp]

In result page the text doesn't appear








-- 
View this message in context: 
http://www.nabble.com/System.out-into-interceptor-tp22535922p22535922.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: Fileupload : Restricted contentType is working fine but no proper error message is shown to user

2009-03-16 Thread sajidbigler

Hi Ravindra,

I have done it but really dont no why it dint got pasted properly on forum

action name=MMSUpload

class=com.teleparadigm.mms.application.mms.MMSUploadAction
interceptor-ref name=i18n /
interceptor-ref name=fileUpload

image/png,image/gif,image/jpeg

/interceptor-ref
interceptor-ref name=basicStack /
interceptor-ref name=validation /
result name=input/pages/ComposeMMS.jsp/result
result name=error/pages/ComposeMMS.jsp/result
result/pages/upload_success.jsp/result
/action

-- 
View this message in context: 
http://www.nabble.com/Fileupload-%3A-Restricted-contentType-is-working-fine-but-no-proper-error-message-is-shown-to-user-tp22535689p22536107.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: Fileupload : Restricted contentType is working fine but no proper error message is shown to user

2009-03-16 Thread sajidbigler

I have included this but still errors wont be send to end user and more over
surprizingly why the forum trims these lines when i copy/paste from my
struts.xml :(

image/png,image/gif,image/jpeg
-- 
View this message in context: 
http://www.nabble.com/Fileupload-%3A-Restricted-contentType-is-working-fine-but-no-proper-error-message-is-shown-to-user-tp22535689p22536171.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: Fileupload : Restricted contentType is working fine but no proper error message is shown to user

2009-03-16 Thread ravindra
Check this page,

http://cwiki.apache.org/WW/file-upload.html

Make sure you have all jar files and other properties they mentioned in it.


-Original Message-
From: sajidbigler [mailto:sajidbig...@gmail.com] 
Sent: Monday, March 16, 2009 4:47 PM
To: user@struts.apache.org
Subject: RE: Fileupload : Restricted contentType is working fine but no
proper error message is shown to user


Hi Ravindra,

I have done it but really dont no why it dint got pasted properly on forum

action name=MMSUpload

class=com.teleparadigm.mms.application.mms.MMSUploadAction
interceptor-ref name=i18n /
interceptor-ref name=fileUpload
image/png,image/gif,image/jpeg
/interceptor-ref
interceptor-ref name=basicStack /
interceptor-ref name=validation /
result name=input/pages/ComposeMMS.jsp/result
result name=error/pages/ComposeMMS.jsp/result
result/pages/upload_success.jsp/result
/action

-- 
View this message in context:
http://www.nabble.com/Fileupload-%3A-Restricted-contentType-is-working-fine-
but-no-proper-error-message-is-shown-to-user-tp22535689p22536107.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





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



RE: Fileupload : Restricted contentType is working fine but no proper error message is shown to user

2009-03-16 Thread sajidbigler

Error on Console

Mar 16, 2009 4:50:49 PM
com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
SEVERE: Content-Type not allowed: upload simplifiedapi.pdf
upload__1ed47216_1200f02e810__8000_0001.tmp application/pdf

Error on Browser

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it
from fulfilling this request.

exception

java.lang.NullPointerException
java.io.FileInputStream.init(FileInputStream.java:103)

com.teleparadigm.mms.application.smssubcription.SMSSubscriptionAction.execute(SMSSubscriptionAction.java:89)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)

com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:440)

com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:279)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)

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

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

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

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)

com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)

com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)

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

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)

com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)

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

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)

org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)

com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)

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

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)

org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)

com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)

org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:306)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)

com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:148)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)

org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)

org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)

org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)

note The full stack trace of the root cause is available in the Apache
Tomcat/6.0.16 logs.
-- 
View this message in context: 
http://www.nabble.com/Fileupload-%3A-Restricted-contentType-is-working-fine-but-no-proper-error-message-is-shown-to-user-tp22535689p22536214.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: System.out into interceptor

2009-03-16 Thread Nils-Helge Garli Hegvik
Please don't create new threads for existing questions. Obviously,
System.out won't print to the JSP. So you have to put the message
somewhere (request, session, action) your JSP can look it up and use
it.

Nils-H

On Mon, Mar 16, 2009 at 12:04 PM, PEGASUS84 pegasu...@hotmail.it wrote:

 excuse me!!!
 how can I show in a jsp page the text which is into an interceptor


 [snipp]

 public String intercept(.

 System.out.print(text)

 [/snipp]

 In result page the text doesn't appear








 --
 View this message in context: 
 http://www.nabble.com/System.out-into-interceptor-tp22535922p22535922.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



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



RE: Fileupload : Restricted contentType is working fine but no proper error message is shown to user

2009-03-16 Thread sajidbigler

I think if jars are not included properly it would  not even allow me to
submit correct files() but i can do every thing and more over its telling
the file is not a correct contentType but no message is shown to user in
browser :(
i even kept

struts.properties

struts.custom.i18n.resources=MMSApplicationMessages
struts.messages.error.uploading=General Error could not upload files
struts.messages.error.file.too.large=File Size is too Large than expected
struts.messages.error.content.type.not.allowed=uploaded file does not match
the expected content types specified



i have done and followed all steps and following are the jars in my
application(MMSApplication\WebRoot\WEB-INF\lib)

commons-beanutils-1.7.0.jar
commons-fileupload-1.2.1.jar
commons-io-1.4.jar
commons-logging-1.0.4.jar
commons-logging-api-1.1.jar
commons-validator-1.3.1.jar
dwr-1.1.1.jar
freemarker-2.3.13.jar
json-lib-2.1.jar
jug-2.0.0.jar
jxl.jar
mysql-connector-java-5.0.4-bin.jar
ognl-2.6.11.jar
struts2-config-browser-plugin-2.1.6.jar
struts2-convention-plugin-2.1.6.jar
struts2-core-2.1.6.jar
struts2-dojo-plugin-2.1.6.jar
struts2-dwr-plugin-2.1.6.jar
struts2-jasperreports-plugin-2.1.6.jar
struts2-jfreechart-plugin-2.1.6.jar
struts2-jsf-plugin-2.1.6.jar
struts2-testng-plugin-2.1.6.jar
xpp3_min-1.1.3.4.O.jar
xstream-1.2.2.jar
xwork-2.1.2.jar


struts.xml

action name=SMSSubscription

class=com.teleparadigm.mms.application.smssubcription.SMSSubscriptionAction
interceptor-ref name=i18n /
interceptor-ref name=fileUpload

application/vnd.ms-excel

/interceptor-ref
interceptor-ref name=basicStack /
interceptor-ref name=validation /
result name=input
/pages/ComposeSMSSubscriptions.jsp
/result
result name=error
/pages/ComposeSMSSubscriptions.jsp
/result
result/pages/upload_success.jsp/result
/action


-- 
View this message in context: 
http://www.nabble.com/Fileupload-%3A-Restricted-contentType-is-working-fine-but-no-proper-error-message-is-shown-to-user-tp22535689p22536371.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: Fileupload : Restricted contentType is working fine but no proper error message is shown to user

2009-03-16 Thread sajidbigler

why forum skips

files \MMSApplication\WebRoot\WEB-INF\lib in bracket and param
name=allowedTypes in struts.xml while i post it ? :(

application/vnd.ms-excel
-- 
View this message in context: 
http://www.nabble.com/Fileupload-%3A-Restricted-contentType-is-working-fine-but-no-proper-error-message-is-shown-to-user-tp22535689p22536405.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: Fileupload : Restricted contentType is working fine but no proper error message is shown to user

2009-03-16 Thread Dave Newton

sajidbigler wrote:

why forum skips

files \MMSApplication\WebRoot\WEB-INF\lib in bracket and param
name=allowedTypes in struts.xml while i post it ? :(

application/vnd.ms-excel


Probably because it tries to interpret tags as actual tags; that's why 
using the mailing list directly and posting plain-text emails is the 
most reliable way to convey information.


Barring that you could use a code snippet service like pastebin/etc. and 
eliminate all possible user errors.


Dave

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



Re: Fileupload : Restricted contentType is working fine but no proper error message is shown to user

2009-03-16 Thread Dave Newton

sajidbigler wrote:

i have done and followed all steps and following are the jars in my
application(MMSApplication\WebRoot\WEB-INF\lib)

commons-beanutils-1.7.0.jar
commons-fileupload-1.2.1.jar
commons-io-1.4.jar
commons-logging-1.0.4.jar
commons-logging-api-1.1.jar
commons-validator-1.3.1.jar
dwr-1.1.1.jar
freemarker-2.3.13.jar
json-lib-2.1.jar
jug-2.0.0.jar
jxl.jar
mysql-connector-java-5.0.4-bin.jar
ognl-2.6.11.jar
struts2-config-browser-plugin-2.1.6.jar
struts2-convention-plugin-2.1.6.jar
struts2-core-2.1.6.jar
struts2-dojo-plugin-2.1.6.jar
struts2-dwr-plugin-2.1.6.jar
struts2-jasperreports-plugin-2.1.6.jar
struts2-jfreechart-plugin-2.1.6.jar
struts2-jsf-plugin-2.1.6.jar
struts2-testng-plugin-2.1.6.jar
xpp3_min-1.1.3.4.O.jar
xstream-1.2.2.jar
xwork-2.1.2.jar


You have a large number of plugins, many of which introduce their own 
dependencies, which you do not list. This may not be the source of your 
immediate problem, but is almost certainly not what you want. For 
example, the Jasper Reports plugin requires.. Jasper Reports, and its 
dependencies, which you don't list.


Dave


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



Re: Struts 2 instance creation in memorey

2009-03-16 Thread Sumit Agarwal

Well i have one doubt regarding interceptor and value stack:-

i have read interceptor can store and read the data from value stack.well if
interceptor is defined in the stack.as per below answer one stack will be
create for interceptor and  two instance(for two request) for value stack
then in this case which value stack instance will be refer by the
interceptor?
looking forward to hear from all of you guys.

Thanks in advance.



newton.dave wrote:
 
 Sumit Agarwal wrote:
 we are given 2 request for this application from different system
   at a time.As per Struts2 two Action instance will be created right?
 
 Correct: unlike servlets or Struts 1 actions, Struts 2 actions are 
 created per-request.
 
 I wanna know how many value stack instance will get create in memory?
 
 Two, one for each action, otherwise it'd defeat the purpose of having 
 separate action instances.
 
 How many Action context instance will get create in memory?
 
 Action contexts are thread-local variables, and there's one per... 
 action context.
 
 how many interceptor instance will get create?
 
 Depends, but in general there will be one interceptor stack for a Struts 
 2 package, and it's created at startup, not per-request.
 
 If an action has configured its own interceptors then there can be 
 multiple interceptor stacks, but they're still not created per-request 
 (and interceptors are not inherently thread-safe).
 
 Dave
 
 
 -
 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-instance-creation-in-memorey-tp22388082p22537006.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: Type conversion exceptions

2009-03-16 Thread ryangr

Okay, I changed it back to settings[0] type syntax (I had tried it before and
it didn't work), so now I have this:

s:iterator value=%{settings} status=rowstatus
tr
th
input 
name=settings[s:property value=#rowstatus.index
/].title value=s:property value=title / type=hidden /
label 
for=setting_s:property value=id /

s:property value=title /:
/label
/th
td
input 
id=setting_s:property value=id /
name=settings[s:property value=#rowstatus.index /].value
value=s:property value=value / /
/td
/tr
/s:iterator

And now I am getting this in the logs (repeated for each attribute id,
title, value):

ERROR com.opensymphony.xwork2.util.InstantiatingNullHandler  - Could not
create and/or set value back on to object
ognl.OgnlException: settings [java.lang.IllegalArgumentException: argument
type mismatch]
ERROR com.opensymphony.xwork2.interceptor.ParametersInterceptor  -
ParametersInterceptor - [setParameters]: Unexpected Exception caught setting
'settings[0].title' on 'class com.rjssoft.webdocs.admin.SettingAction: Error
setting expression 'settings[0].title' with value
'[Ljava.lang.String;@185fe0c'

So again, it's failing trying to set a String[] to a String value on the
Setting object which has all of the getters/setters and are defined to
handle String values.

Any insight? 

Ryan



dusty wrote:
 
 your syntax for the field name should be 
 ...name = settings[]  rather than name = settings()
 
 Also, I think your action expects to build a List of Settings rather than
 Map of settings.  If that is the case then you don't want to use key
 values in settings[ASDF1-123AS-123SA-123] you want to use an index for a
 List, settings[0]...  settings[1]..., etc.  You don't need the Key_xxx in
 -conversion.properties file if your target is a List.
 
 I am wondering if you want struts to load your Settings models from the db
 based on the ID.  If that was the case then you would need to use an
 entirely different pattern with a custom TypeConverter...
 
 
 
 ryangr wrote:
 
 This is probably going to be a really simple solution, but after
 searching I still haven't quite found an answer so I appreciate any help
 with this. I'm using 2.0.14 and trying to do type conversion on a custom
 collection (called settings in this case, it is just an extended
 ArrayList). I'm getting the following in my logs:
 
 Unexpected Exception caught setting
 'settings(D176A8AA-1636-4AFF-9C71-16A21DFCEDA7).id' on 'class
 com.rjssoft.webdocs.admin.SettingAction: Error setting expression
 'settings(D176A8AA-1636-4AFF-9C71-16A21DFCEDA7).id' with value
 '[Ljava.lang.String;@1f796d0'
 
 Unexpected Exception caught setting
 'settings(D176A8AA-1636-4AFF-9C71-16A21DFCEDA7).title' on 'class
 com.rjssoft.webdocs.admin.SettingAction: Error setting expression
 'settings(D176A8AA-1636-4AFF-9C71-16A21DFCEDA7).title' with value
 '[Ljava.lang.String;@1ce64f6'
 
 Unexpected Exception caught setting
 'settings(D176A8AA-1636-4AFF-9C71-16A21DFCEDA7).value' on 'class
 com.rjssoft.webdocs.admin.SettingAction: Error setting expression
 'settings(D176A8AA-1636-4AFF-9C71-16A21DFCEDA7).value' with value
 '[Ljava.lang.String;@6bba64'
 
 Now, obviously it is trying to set a String[] to a String value and
 failing; however, according to the official doc on type conversion
 there is no additional processing. The form consists of:
 
 ...
 s:iterator value=%{settings}
  tr
  th
  input name=settings(s:property value=id /).id
 value=s:property value=id / type=hidden /   
 
  input name=settings(s:property value=id /).title
 value=s:property value=title / type=hidden /
  label for=setting_s:property value=id /
  s:property value=title /:
  /label
  /th
  td
  input id=setting_s:property value=id /
 name=settings(s:property value=id /).value value=s:property
 value=value / /
  /td
  /tr
 /s:iterator
 
 The values that come through are:
 Setting params settings(D176A8AA-1636-4AFF-9C71-16A21DFCEDA7).id = [
 D176A8AA-1636-4AFF-9C71-16A21DFCEDA7 ]
 settings(D176A8AA-1636-4AFF-9C71-16A21DFCEDA7).value = [ 192.168.1.1 ]
 

Re: Actionerror's wont be shown when ajax call or when we do type=redirectAction using struts2.1.6

2009-03-16 Thread Greg Lindholm

For Scenario 1 I'm still not sure what you are asking about, the
RedirectMessageInterceptor is used to preserve messages across a redirect
but now you are saying there is no redirect so the interceptor is certainly
not going to do anything.   You might be better off starting over with
scenario 1 and posting a new question with a complete description of the
problem and what you are trying to accomplish.

For Scenario 2,  The action MMSUpload is not including the
RedirectMessageInterceptor in the interceptor stack.  By specifying
interceptor-ref's in the action you are replacing the default interceptor
stack for that action.  So MyStack is not being used and
RedirectMessageInterceptor is not in the stack.

Additionally, your definition of myStack is strange, you probably do not
want both paramsPrepareParamsStack and defaultStack together.  You will be
duplicating many interceptors and probably get some odd behavior.  You
probably want to include either paramsPrepareParamsStack or defaultStack but
not both.

The source code for 2.1.6 is include in the distribution you download from
the Struts site, it's in the 'src' folder.  
 



sajidbigler wrote:
 
 Hi please see Answers in bold
 Greg:
 Sorry, I can't understand what you are talking about in scenario 1, on a
 redirect result there is no output response except the http redirect
 command.
 Sajid:Its normal Ajax call no redirect.
 
 signup.jsp
 
 html
 head
 titleService Owner/title
 link href=s:url value='/css/main.css'/ rel=stylesheet
   type=text/css /
 sx:head cache=true debug=true parseContent=true/
 /head
 script language=JavaScript type=text/javascript
 function avalibility(username) {
dojo.io.bind({
 url: s:url
 value='/userAvailableCheckAction.action'/?username=+username,
 load: function(type, data, evt) {
   var username1 = dojo.byId(username);
   
   username1.value=data
 },
 mimeType: text/html
 });
 }
 
 /script
 s:form action=doSignUP method=POST   theme=simple
 s:actionerror /s:actionmessage/
 s:textfield label=User Name name=username required=true
 requiredposition=left id=username
 onblur=javascript:avalibility(this.value);return false;  /
 s:submit value=Save align=center/
 /s:form
 
 struts.xml
 
 interceptors
   interceptor name=redirectMessage
   
 class=com.teleparadigm.mms.application.common.RedirectMessageInterceptor
 /
   interceptor-stack name=myStack
   interceptor-ref name=redirectMessage /
   interceptor-ref 
 name=paramsPrepareParamsStack /
   interceptor-ref name=defaultStack /
   /interceptor-stack
   /interceptors
   default-interceptor-ref name=myStack /
 
   action name=userAvailableCheckAction
   
 class=com.teleparadigm.mms.application.useravailability.UserAvailabilityAction
   result/pages/available.jsp/result
   /action
 
 available.jsp
 
 %...@taglib prefix=s uri=/struts-tags%
 % System.out.println(In JSP username
 +request.getParameter(username));
 System.out.println(In JSP exist +request.getParameter(exist));
 
 if(request.getParameter(exist)==null){
 %
 s:property value=%{username} /
 %}else{%
 alert('User Already Exist !...');
 %}%
 
 UserAvailabilityAction.java
 
 package com.teleparadigm.mms.application.useravailability;
 
 import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpSession;
 
 import org.apache.struts2.interceptor.ServletRequestAware;
 
 import com.opensymphony.xwork2.ActionContext;
 import com.opensymphony.xwork2.ActionSupport;
 import com.teleparadigm.mms.application.common.Owner;
 import com.teleparadigm.mms.application.login.LoginDAO;
 
 public class UserAvailabilityAction  extends ActionSupport  implements
 ServletRequestAware
 {
   
 
   private HttpServletRequest request;
 
   public void setServletRequest(HttpServletRequest request){
   this.request = request;
   }
 
   public HttpServletRequest getServletRequest(){
   return request;
   }
 
   UserAvailabilityDAO uadao=new UserAvailabilityDAO();
   private String username = null;
   
   public String execute() throws Exception {
   System.out.println(UserAvailabilityAction---+this. 
 getUsername());
   boolean result=uadao.checkUserNameAvailability(this.
 getUsername().trim());
   System.out.println(result---+result);
 
 
   if(!result){
   return SUCCESS;
   }else{
   username=;
   addActionError(User Already Exists..plz use another 
 username..);
   return SUCCESS;
   }
   }
 

Re: Type conversion exceptions

2009-03-16 Thread Lukasz Lenart
2009/3/16 ryangr grigg...@gmail.com:
 ERROR com.opensymphony.xwork2.util.InstantiatingNullHandler  - Could not
 create and/or set value back on to object
 ognl.OgnlException: settings [java.lang.IllegalArgumentException: argument
 type mismatch]
 ERROR com.opensymphony.xwork2.interceptor.ParametersInterceptor  -
 ParametersInterceptor - [setParameters]: Unexpected Exception caught setting
 'settings[0].title' on 'class com.rjssoft.webdocs.admin.SettingAction: Error
 setting expression 'settings[0].title' with value
 '[Ljava.lang.String;@185fe0c'

settings is a List?
could you take a look on rendered page source, are there different
indexes (settings[x].title)?


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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



Need help using html:link

2009-03-16 Thread hermann . x . lau
I am having trouble getting two links to work. The links render properly 
but when I click on the links, it doesn't forward to the appropriate page. 
I am not getting any exceptions on the server either. 
What am I missing?

The jsp: 
p align = center  
 bean:message key=welcome.webtrack.info.text / 
 BR 
 BR 
 html:link action=displaysearchpage.do?methodtocall=searchAcct   
 bean:message key=welcome.searchaccounts.link.text / 
 /html:link 
 BR 
 BR 
 html:link action=displaysearchpage.do?methodtocall=searchBatch  
 bean:message key=welcome.searchbatch.link.text / 
 /html:link 
 /p 

The action-mapping in struts-config file:
action path=/displaysearchpage 
  type=com.bankone.adf.webtrack.actions.DisplaySearchPageAction 
  parameter=methodtocall 
  forward name=batch path=/batchsearch.jsp 
  /forward 
  forward name=welcome path=/accountsearch.jsp 
  /forward 
 /action 

The DisplaySearchPageAction class:
public ActionForward searchAcct(ActionMapping mapping, ActionForm form, 
HttpServletRequest request, HttpServletResponse response) 
throws Exception { 
AccountSearchCriteriaForm acctSearch = new 
AccountSearchCriteriaForm(); 
 
request.setAttribute(accountSearchCriteriaForm, acctSearch); 
return mapping.findForward(welcome); 
} 

public ActionForward searchBatch(ActionMapping mapping, ActionForm form, 
HttpServletRequest  request, HttpServletResponse response) { 
BatchSearchCriteriaForm batchSearch = new BatchSearchCriteriaForm(); 
 
request.setAttribute(batchSearchCriteriaForm, batchSearch); 
return mapping.findForward(batch); 
} 

-
This communication is for informational purposes only. It is not
intended as an offer or solicitation for the purchase or sale of
any financial instrument or as an official confirmation of any
transaction. All market prices, data and other information are not
warranted as to completeness or accuracy and are subject to change
without notice. Any comments or statements made herein do not
necessarily reflect those of JPMorgan Chase  Co., its subsidiaries
and affiliates.

This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law. If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED. Although this transmission and any
attachments are believed to be free of any virus or other defect
that might affect any computer system into which it is received and
opened, it is the responsibility of the recipient to ensure that it
is virus free and no responsibility is accepted by JPMorgan Chase 
Co., its subsidiaries and affiliates, as applicable, for any loss
or damage arising in any way from its use. If you received this
transmission in error, please immediately contact the sender and
destroy the material in its entirety, whether in electronic or hard
copy format. Thank you.

Please refer to http://www.jpmorgan.com/pages/disclosures for
disclosures relating to UK legal entities.

Re: Struts2 Standards, guidelines, recommendations

2009-03-16 Thread Norris Shelton
Just Struts2.  I will tackle the others later.

 
Norris Shelton
Software Engineer
Sun Certified Java 1.1 Programmer
Shelton Consulting, LLC
ICQ# 26487421
AIM NorrisEShelton
YIM norrisshelton





From: dusty dustin_pea...@yahoo.com
To: user@struts.apache.org
Sent: Sunday, March 15, 2009 1:05:52 AM
Subject: Re: Struts2  Standards, guidelines, recommendations


Are you just looking for a Struts2 convention or the whole stack, presumably
Spring/Guice Hibernate/JDBC?




sheltonn wrote:
 
 I was looking for something akin to the java code convention standard
 (http://java.sun.com/docs/codeconv/).  My guess is that there is nothing
 out there for that.  My guess that would boil down to things like naming
 conventions for Actions, execute methods, etc.
 
 For recommendations (don't ask me why they want 2 separate documents), I
 was thinking more along the lines of use 2.1, use the
 struts2-convention-plugin and listing what that entails.
 
  
 Norris Shelton
 Software Engineer
 Sun Certified Java 1.1 Programmer
 Shelton Consulting, LLC
 ICQ# 26487421
 AIM NorrisEShelton
 YIM norrisshelton
 
 
 
 
 
 From: Dave Newton newton.d...@yahoo.com
 To: Struts Users Mailing List user@struts.apache.org
 Sent: Wednesday, March 11, 2009 5:08:57 PM
 Subject: Re: Struts2  Standards, guidelines, recommendations
 
 Norris Shelton wrote:
 I am working to get Struts2 approved as a production technology.  Can you
 point me
 to any standards or guidelines or implementation recommendations?
 
 What kind of standards? What kind of guidelines or implementation
 recommendations are you looking for?
 
 Dave
 
 
 -
 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/Struts2--Standards%2C-guidelines%2C-recommendations-tp22461800p22519880.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: Type conversion exceptions

2009-03-16 Thread ryangr

settings is a SettingList which is just an extended ArrayListSetting.

The rendered source looks like:
input value=192.168.1.1 name=settings[0].value
id=setting_D176A8AA-1636-4AFF-9C71-16A21DFCEDA7/

Currently there is only one Setting, but adding another arbitrary entry does
come up with settings[1].value, etc.

Ryan


Lukasz Lenart wrote:
 
 2009/3/16 ryangr grigg...@gmail.com:
 ERROR com.opensymphony.xwork2.util.InstantiatingNullHandler  - Could not
 create and/or set value back on to object
 ognl.OgnlException: settings [java.lang.IllegalArgumentException:
 argument
 type mismatch]
 ERROR com.opensymphony.xwork2.interceptor.ParametersInterceptor  -
 ParametersInterceptor - [setParameters]: Unexpected Exception caught
 setting
 'settings[0].title' on 'class com.rjssoft.webdocs.admin.SettingAction:
 Error
 setting expression 'settings[0].title' with value
 '[Ljava.lang.String;@185fe0c'
 
 settings is a List?
 could you take a look on rendered page source, are there different
 indexes (settings[x].title)?
 
 
 Regards
 -- 
 Lukasz
 http://www.lenart.org.pl/
 
 -
 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/Type-conversion-exceptions-tp22497261p22540046.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: Type conversion exceptions

2009-03-16 Thread Lukasz Lenart
2009/3/16 ryangr grigg...@gmail.com:
 settings is a SettingList which is just an extended ArrayListSetting.

That can be a problem, generics are erased during compilation and Ognl
doesn't know how to convert array to SettingList, did you try to
prepare converter for it?


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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



Re: Struts2 Standards, guidelines, recommendations

2009-03-16 Thread Dave Newton

Norris Shelton wrote:

Just Struts2.  I will tackle the others later.


Convention's naming (uh) conventions are covered in the Convention 
plugin docs.


Other than that I'm not sure there are any hard-and-fast rules about how 
best to use S2. I guess I'm still not quite sure what you're looking 
for, really :/


Dave


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



Re: System.out into interceptor

2009-03-16 Thread PEGASUS84

that's right!
now i realize this:

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.Interceptor;
import com.opensymphony.xwork2.Action;
import javax.servlet.http.HttpServletRequest;
import com.opensymphony.xwork2.ActionContext;
import java.util.*;


public class filtro implements Interceptor {

private HttpServletRequest request;
  public void setServletRequest(HttpServletRequest request){
this.request = request;
  }

  public HttpServletRequest getServletRequest(){
return request;
  }



public void destroy() {
}
public void init() {
}
public String intercept( ActionInvocation actionInvocation) throws
Exception{

Map session = actionInvocation.getInvocationContext().getSession();
utente user = (utente)session.get(autenticato);
if (user != null) 
   request.setAttribute(ciao,condizione);
return Action.ERROR;


}

}

and into jsp page:

%out.print(request.getParameter(ciao))%

but it doesn't work
-- 
View this message in context: 
http://www.nabble.com/System.out-into-interceptor-tp22535922p22541213.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



request into interceptor

2009-03-16 Thread PEGASUS84

How can i set an attribute in the curret http request into an interceptor?
-- 
View this message in context: 
http://www.nabble.com/request-into-interceptor-tp22541443p22541443.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



how to prevent JSP from interpreting ${0}

2009-03-16 Thread John Cartwright

Hello All,

I'm trying to get the literal string this is a test: ${0} to be 
rendered in my JSP output.  Can someone please tell me how to protect 
this string from getting evaluated on the server-side?


Thanks!

--john


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



Re: request into interceptor

2009-03-16 Thread Musachy Barroso
Please don't create new threads for existing questions. Obviously,
System.out won't print to the JSP. So you have to put the message
somewhere (request, session, action) your JSP can look it up and use
it.

Nils-H

http://struts.apache.org/2.0.6/docs/how-can-we-access-the-httpservletrequest.html

musachy

On Mon, Mar 16, 2009 at 1:31 PM, PEGASUS84 pegasu...@hotmail.it wrote:

 How can i set an attribute in the curret http request into an interceptor?
 --
 View this message in context: 
 http://www.nabble.com/request-into-interceptor-tp22541443p22541443.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





-- 
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: how to prevent JSP from interpreting ${0}

2009-03-16 Thread Musachy Barroso
If you don't have any EL on that page you can disable it using the
isELIgnored attribute of the page directive.

musachy

On Mon, Mar 16, 2009 at 1:46 PM, John Cartwright
john.c.cartwri...@noaa.gov wrote:
 Thanks for the suggestion, Lukasz.  That's one of the things that I tried,
 but couldn't get it to work for me.  I need the braces to appear as such in
 the generated page as it's part of a javascript expression.

 I found a workable solution in:

 this is a test: $\{0\}


 but was hoping there might be a better way.

 --john


 Lukasz Lenart wrote:

 2009/3/16 John Cartwright john.c.cartwri...@noaa.gov:


 I'm trying to get the literal string this is a test: ${0} to be
 rendered
 in my JSP output.  Can someone please tell me how to protect this string
 from getting evaluated on the server-side?


 Use HTML entities [1]

 [1] http://www.w3schools.com/tags/ref_ascii.asp


 Regards


 -
 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



Re: System.out into interceptor

2009-03-16 Thread Nils-Helge Garli Hegvik
You're setting a request attribute, but trying to access a request
parameter. Also, I would recommend that you do not access the output
stream directly. I suggest you take some time to study some
servlet/jsp tutorials, and then move on to the Struts 2 bootstrap
guides.

Nils-H

On Mon, Mar 16, 2009 at 5:31 PM, PEGASUS84 pegasu...@hotmail.it wrote:

 that's right!
 now i realize this:

 import com.opensymphony.xwork2.ActionInvocation;
 import com.opensymphony.xwork2.interceptor.Interceptor;
 import com.opensymphony.xwork2.Action;
 import javax.servlet.http.HttpServletRequest;
 import com.opensymphony.xwork2.ActionContext;
 import java.util.*;


 public class filtro implements Interceptor {

 private HttpServletRequest request;
  public void setServletRequest(HttpServletRequest request){
    this.request = request;
  }

  public HttpServletRequest getServletRequest(){
    return request;
  }



 public void destroy() {
 }
 public void init() {
 }
 public String intercept( ActionInvocation actionInvocation) throws
 Exception{

 Map session = actionInvocation.getInvocationContext().getSession();
 utente user = (utente)session.get(autenticato);
 if (user != null)
   request.setAttribute(ciao,condizione);
 return Action.ERROR;


 }

 }

 and into jsp page:

 %out.print(request.getParameter(ciao))%

 but it doesn't work
 --
 View this message in context: 
 http://www.nabble.com/System.out-into-interceptor-tp22535922p22541213.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



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



Re: System.out into interceptor

2009-03-16 Thread Lukasz Lenart
On Mon, Mar 16, 2009 at 5:31 PM, PEGASUS84 pegasu...@hotmail.it wrote:
 %out.print(request.getParameter(ciao))%

Simplest solution
%= request.getParameter(ciao) %


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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



RE: Required field only works with text fields?

2009-03-16 Thread Griffith, Michael *
Ok, So I am being a bone-head.  

When I added the @RequiredStringValidator to the model, the validation
is in sync with what is being required on the form. That makes sense to
me, but... 

How are relationships handled? I have a form control as such:

s:select key=component.status name=selectedStatus required=true
tabindex=12
   headerKey=-1
   headerValue=-- Select Status --
   list=statusList
   listKey=id
   value=%{status.id}
   listValue=description/

And the relationship is being managed via a JPA 
@ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE},
fetch=FetchType.EAGER)
@JoinColumn(name = STATUS)
public Status getStatus() {
return status;
}

What sort of annotation should I use to validate the user selected an
item from the list?

Any reply is appreciated...

MG


-Original Message-
From: stanl...@gmail.com [mailto:stanl...@gmail.com]
Sent: Friday, March 13, 2009 6:01 PM
To: Struts Users Mailing List
Subject: Re: Required field only works with text fields?

The required attribute only paints the asterisk -- it has nothing to do
with actually requiring input.  Nice huh?

Peace,
Scott

On Fri, Mar 13, 2009 at 4:14 PM, Griffith, Michael * 
michael.griff...@fda.hhs.gov wrote:

 Hi all,

 I just noticed that the only required field validations that seem to
 be working in my form are text field validations.

 Any HTML tag that renders a list, check box or radio button doesn't
 validate, even though the template shows the field as required.

 In other words, this tag:
 s:radio key=component.modified name=modifiedFromSource
 list=#{'Y':'Yes', 'N':'No'} required=true tabindex=7/

 Shows a radio button with the * required indicator, but the form is
 allowed to be submitted without a button selected, which of course
 breaks my request/response cycle...

 Do I need to do something special to make the required non-text inputs
 to behave as I expect?

 Any help is appreciated.

 Best Regards,

 MG





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



Re: System.out into interceptor

2009-03-16 Thread Chris Pratt
Even simplester solution ${param.caio}
  (*Chris*)

On Mon, Mar 16, 2009 at 11:05 AM, Lukasz Lenart 
lukasz.len...@googlemail.com wrote:

 On Mon, Mar 16, 2009 at 5:31 PM, PEGASUS84 pegasu...@hotmail.it wrote:
  %out.print(request.getParameter(ciao))%

 Simplest solution
 %= request.getParameter(ciao) %


 Regards
 --
 Lukasz
 http://www.lenart.org.pl/

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




Re: Type conversion exceptions

2009-03-16 Thread ryangr

Well I can't seem to find documentation or examples of how to use the
convertValue() API. This is what each call outputs (it seems both versions
get called each time the converter is run):

Called convertValue(Map, Object, Member, String, Object, Class)
target: com.rjssoft.webdocs.admin.settingact...@12cb585
member: public void
com.rjssoft.webdocs.admin.SettingAction.setSettings(com.rjssoft.webdocs.setting.SettingList)
propertyName: settings
value (java.util.ArrayList): []
toType: class com.rjssoft.webdocs.setting.SettingList

Called convertValue(Map, Object, Class)
context: ognl.ognlcont...@eb7f1c7f
o (java.util.ArrayList): []
toClass: class com.rjssoft.webdocs.setting.SettingList

It appears both values objects (value and o, respectively) are completely
empty...

Ryan



ryangr wrote:
 
 That makes sense...I've added a converter for it similar to others that
 already exist in the app, but it doesn't appear to be calling
 convertFromString which the others use. Instead, it seems to be calling
 convertValue(Map, Object, Member, String, Object, Class) which I do not
 see in the Struts 2.0.14 API:
 
 http://struts.apache.org/2.0.14/struts2-core/apidocs/org/apache/struts2/util/StrutsTypeConverter.html
 
 Is there documentation on this somewhere that I'm missing? Is this what is
 supposed to be used? None of our other typeconverters use this method
 perhaps because it wasn't documented...
 
 Ryan
 
 
 Lukasz Lenart wrote:
 
 2009/3/16 ryangr grigg...@gmail.com:
 settings is a SettingList which is just an extended ArrayListSetting.
 
 That can be a problem, generics are erased during compilation and Ognl
 doesn't know how to convert array to SettingList, did you try to
 prepare converter for it?
 
 
 Regards
 -- 
 Lukasz
 http://www.lenart.org.pl/
 
 -
 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/Type-conversion-exceptions-tp22497261p22541495.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: Need help using html:link

2009-03-16 Thread benjamin haimerl

hi hermann

imho it should work..

which page will be shown when you follow the link?
just an empty page?
Then i guess your action returned null as ActionForward, or an
notConfigured forward

or did you saw an error page
for example:
http status 404 - invalid path was requestet

that means the action isnt configured (well)

add some log points to your action, to see if the class will be called
or start the tomcat in debug to step through your action
to be sure the ActionForward Object contains the correct information
if the return value is null.. you will see an empty page
without any exceptions

greetings
benjamin haimerl


hermann.x@jpmchase.com wrote:
I am having trouble getting two links to work. The links render properly 
but when I click on the links, it doesn't forward to the appropriate page. 
I am not getting any exceptions on the server either. 
What am I missing?


The jsp: 
p align = center  
 bean:message key=welcome.webtrack.info.text / 
 BR 
 BR 
 html:link action=displaysearchpage.do?methodtocall=searchAcct   
 bean:message key=welcome.searchaccounts.link.text / 
 /html:link 
 BR 
 BR 
 html:link action=displaysearchpage.do?methodtocall=searchBatch  
 bean:message key=welcome.searchbatch.link.text / 
 /html:link 
 /p 


The action-mapping in struts-config file:
action path=/displaysearchpage 
  type=com.bankone.adf.webtrack.actions.DisplaySearchPageAction 
  parameter=methodtocall 
  forward name=batch path=/batchsearch.jsp 
  /forward 
  forward name=welcome path=/accountsearch.jsp 
  /forward 
 /action 


The DisplaySearchPageAction class:
public ActionForward searchAcct(ActionMapping mapping, ActionForm form, 
HttpServletRequest request, HttpServletResponse response) 
throws Exception { 
AccountSearchCriteriaForm acctSearch = new 
AccountSearchCriteriaForm(); 
 
request.setAttribute(accountSearchCriteriaForm, acctSearch); 
return mapping.findForward(welcome); 
} 

public ActionForward searchBatch(ActionMapping mapping, ActionForm form, 
HttpServletRequest  request, HttpServletResponse response) { 
BatchSearchCriteriaForm batchSearch = new BatchSearchCriteriaForm(); 
 
request.setAttribute(batchSearchCriteriaForm, batchSearch); 
return mapping.findForward(batch); 
} 


-
This communication is for informational purposes only. It is not
intended as an offer or solicitation for the purchase or sale of
any financial instrument or as an official confirmation of any
transaction. All market prices, data and other information are not
warranted as to completeness or accuracy and are subject to change
without notice. Any comments or statements made herein do not
necessarily reflect those of JPMorgan Chase  Co., its subsidiaries
and affiliates.

This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law. If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED. Although this transmission and any
attachments are believed to be free of any virus or other defect
that might affect any computer system into which it is received and
opened, it is the responsibility of the recipient to ensure that it
is virus free and no responsibility is accepted by JPMorgan Chase 
Co., its subsidiaries and affiliates, as applicable, for any loss
or damage arising in any way from its use. If you received this
transmission in error, please immediately contact the sender and
destroy the material in its entirety, whether in electronic or hard
copy format. Thank you.

Please refer to http://www.jpmorgan.com/pages/disclosures for
disclosures relating to UK legal entities.
  



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



interceptor and request http

2009-03-16 Thread PEGASUS84

how can I access in the current http request from an interceptor
-- 
View this message in context: 
http://www.nabble.com/interceptor-and-request-http-tp22541808p22541808.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: interceptor and request http

2009-03-16 Thread Wes Wannemacher
ActionContext.getContext().get(StrutsStatics.HTTP_REQUEST);

-Wes

On Mon, Mar 16, 2009 at 3:11 PM, PEGASUS84 pegasu...@hotmail.it wrote:

 how can I access in the current http request from an interceptor
 --
 View this message in context: 
 http://www.nabble.com/interceptor-and-request-http-tp22541808p22541808.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





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



sx:textarea and label

2009-03-16 Thread Ignacio de Córdoba

Hi there,
I have just replaced s:textarea with sx:textarea to get the HTML editor. It
works OK but now I don't see the labels for these textarea fields:

sx:textarea key=headline name=headline/

¿Anybody knows if that is the suppoused behaviour and I must add label
tags my self?

thanks,
Ignacio
-- 
View this message in context: 
http://www.nabble.com/sx%3Atextarea-and-label-tp22543691p22543691.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: Type conversion exceptions

2009-03-16 Thread Lukasz Lenart
2009/3/16 ryangr grigg...@gmail.com:
 It appears both values objects (value and o, respectively) are completely
 empty...

It's strange but anyway you should be able to use Struts2 / XWork2
convertion mechanism, did you setup xwork-conversion.properties file
as mentioned in documentation [1]?

[1] 
http://struts.apache.org/2.x/docs/type-conversion.html#TypeConversion-ASimpleExample


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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



Re: System.out into interceptor

2009-03-16 Thread PEGASUS84

please can you tell me
any quicly method to implement this
because i've not time






Nils-Helge Garli wrote:
 
 You're setting a request attribute, but trying to access a request
 parameter. Also, I would recommend that you do not access the output
 stream directly. I suggest you take some time to study some
 servlet/jsp tutorials, and then move on to the Struts 2 bootstrap
 guides.
 
 Nils-H
 
 On Mon, Mar 16, 2009 at 5:31 PM, PEGASUS84 pegasu...@hotmail.it wrote:

 that's right!
 now i realize this:

 import com.opensymphony.xwork2.ActionInvocation;
 import com.opensymphony.xwork2.interceptor.Interceptor;
 import com.opensymphony.xwork2.Action;
 import javax.servlet.http.HttpServletRequest;
 import com.opensymphony.xwork2.ActionContext;
 import java.util.*;


 public class filtro implements Interceptor {

 private HttpServletRequest request;
  public void setServletRequest(HttpServletRequest request){
    this.request = request;
  }

  public HttpServletRequest getServletRequest(){
    return request;
  }



 public void destroy() {
 }
 public void init() {
 }
 public String intercept( ActionInvocation actionInvocation) throws
 Exception{

 Map session = actionInvocation.getInvocationContext().getSession();
 utente user = (utente)session.get(autenticato);
 if (user != null)
   request.setAttribute(ciao,condizione);
 return Action.ERROR;


 }

 }

 and into jsp page:

 %out.print(request.getParameter(ciao))%

 but it doesn't work
 --
 View this message in context:
 http://www.nabble.com/System.out-into-interceptor-tp22535922p22541213.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


 
 -
 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/System.out-into-interceptor-tp22535922p22544593.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: Need help using html:link

2009-03-16 Thread hermann . x . lau
Benjamin,

When I click on link, it reloads the same (welcome.jsp) page.  It doesn't 
go to an empty page or go to an 404 error page.

I added logging to my action classes and it looks like the classes are 
even being called.  This leads me to believe that the configuration is not 
correct... but I have looked over my config many times and I don't see 
anything wrong with it.  Any ideas?

Thanks for your help!




benjamin haimerl b-ski...@gmx.de 
03/16/2009 03:06 PM
Please respond to
Struts Users Mailing List user@struts.apache.org


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

Subject
Re: Need help using html:link






hi hermann

imho it should work..

which page will be shown when you follow the link?
just an empty page?
Then i guess your action returned null as ActionForward, or an
notConfigured forward

or did you saw an error page
for example:
http status 404 - invalid path was requestet

that means the action isnt configured (well)

add some log points to your action, to see if the class will be called
or start the tomcat in debug to step through your action
to be sure the ActionForward Object contains the correct information
if the return value is null.. you will see an empty page
without any exceptions

greetings
benjamin haimerl


hermann.x@jpmchase.com wrote:
 I am having trouble getting two links to work. The links render properly 

 but when I click on the links, it doesn't forward to the appropriate 
page. 
 I am not getting any exceptions on the server either. 
 What am I missing?

 The jsp: 
 p align = center  
  bean:message key=welcome.webtrack.info.text / 
  BR 
  BR 
  html:link action=displaysearchpage.do?methodtocall=searchAcct  
  bean:message key=welcome.searchaccounts.link.text / 
  /html:link 
  BR 
  BR 
  html:link action=displaysearchpage.do?methodtocall=searchBatch  

  bean:message key=welcome.searchbatch.link.text / 
  /html:link 
  /p 

 The action-mapping in struts-config file:
 action path=/displaysearchpage 
   type=com.bankone.adf.webtrack.actions.DisplaySearchPageAction 
   parameter=methodtocall 
   forward name=batch path=/batchsearch.jsp 
   /forward 
   forward name=welcome path=/accountsearch.jsp 
   /forward 
  /action 

 The DisplaySearchPageAction class:
 public ActionForward searchAcct(ActionMapping mapping, ActionForm form, 
 HttpServletRequest request, HttpServletResponse response) 
 throws Exception { 
 AccountSearchCriteriaForm acctSearch = new 
 AccountSearchCriteriaForm(); 
  
 request.setAttribute(accountSearchCriteriaForm, acctSearch); 
 return mapping.findForward(welcome); 
 } 

 public ActionForward searchBatch(ActionMapping mapping, ActionForm form, 

 HttpServletRequest  request, HttpServletResponse response) { 
 BatchSearchCriteriaForm batchSearch = new BatchSearchCriteriaForm(); 

  
 request.setAttribute(batchSearchCriteriaForm, batchSearch); 
 return mapping.findForward(batch); 
 } 

 -
 This communication is for informational purposes only. It is not
 intended as an offer or solicitation for the purchase or sale of
 any financial instrument or as an official confirmation of any
 transaction. All market prices, data and other information are not
 warranted as to completeness or accuracy and are subject to change
 without notice. Any comments or statements made herein do not
 necessarily reflect those of JPMorgan Chase  Co., its subsidiaries
 and affiliates.

 This transmission may contain information that is privileged,
 confidential, legally privileged, and/or exempt from disclosure
 under applicable law. If you are not the intended recipient, you
 are hereby notified that any disclosure, copying, distribution, or
 use of the information contained herein (including any reliance
 thereon) is STRICTLY PROHIBITED. Although this transmission and any
 attachments are believed to be free of any virus or other defect
 that might affect any computer system into which it is received and
 opened, it is the responsibility of the recipient to ensure that it
 is virus free and no responsibility is accepted by JPMorgan Chase 
 Co., its subsidiaries and affiliates, as applicable, for any loss
 or damage arising in any way from its use. If you received this
 transmission in error, please immediately contact the sender and
 destroy the material in its entirety, whether in electronic or hard
 copy format. Thank you.

 Please refer to http://www.jpmorgan.com/pages/disclosures for
 disclosures relating to UK legal entities.
 


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





-
This communication is for informational purposes only. It is not
intended as an offer or solicitation for the purchase or sale of
any 

Re: System.out into interceptor

2009-03-16 Thread Dave Newton

PEGASUS84 wrote:

please can you tell me
any quicly method to implement this
because i've not time


O_o

Dave








Nils-Helge Garli wrote:

You're setting a request attribute, but trying to access a request
parameter. Also, I would recommend that you do not access the output
stream directly. I suggest you take some time to study some
servlet/jsp tutorials, and then move on to the Struts 2 bootstrap
guides.

Nils-H

On Mon, Mar 16, 2009 at 5:31 PM, PEGASUS84 pegasu...@hotmail.it wrote:

that's right!
now i realize this:

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.Interceptor;
import com.opensymphony.xwork2.Action;
import javax.servlet.http.HttpServletRequest;
import com.opensymphony.xwork2.ActionContext;
import java.util.*;


public class filtro implements Interceptor {

private HttpServletRequest request;
 public void setServletRequest(HttpServletRequest request){
   this.request = request;
 }

 public HttpServletRequest getServletRequest(){
   return request;
 }



public void destroy() {
}
public void init() {
}
public String intercept( ActionInvocation actionInvocation) throws
Exception{

Map session = actionInvocation.getInvocationContext().getSession();
utente user = (utente)session.get(autenticato);
if (user != null)
  request.setAttribute(ciao,condizione);
return Action.ERROR;


}

}

and into jsp page:

%out.print(request.getParameter(ciao))%

but it doesn't work
--
View this message in context:
http://www.nabble.com/System.out-into-interceptor-tp22535922p22541213.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



-
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: System.out into interceptor

2009-03-16 Thread Nils-Helge Garli Hegvik
http://www.google.com/search?q=java+servlet+tutorial
http://struts.apache.org/2.1.6/docs/tutorials.html

Nils-H

On Mon, Mar 16, 2009 at 9:02 PM, PEGASUS84 pegasu...@hotmail.it wrote:

 please can you tell me
 any quicly method to implement this
 because i've not time






 Nils-Helge Garli wrote:

 You're setting a request attribute, but trying to access a request
 parameter. Also, I would recommend that you do not access the output
 stream directly. I suggest you take some time to study some
 servlet/jsp tutorials, and then move on to the Struts 2 bootstrap
 guides.

 Nils-H

 On Mon, Mar 16, 2009 at 5:31 PM, PEGASUS84 pegasu...@hotmail.it wrote:

 that's right!
 now i realize this:

 import com.opensymphony.xwork2.ActionInvocation;
 import com.opensymphony.xwork2.interceptor.Interceptor;
 import com.opensymphony.xwork2.Action;
 import javax.servlet.http.HttpServletRequest;
 import com.opensymphony.xwork2.ActionContext;
 import java.util.*;


 public class filtro implements Interceptor {

 private HttpServletRequest request;
  public void setServletRequest(HttpServletRequest request){
    this.request = request;
  }

  public HttpServletRequest getServletRequest(){
    return request;
  }



 public void destroy() {
 }
 public void init() {
 }
 public String intercept( ActionInvocation actionInvocation) throws
 Exception{

 Map session = actionInvocation.getInvocationContext().getSession();
 utente user = (utente)session.get(autenticato);
 if (user != null)
   request.setAttribute(ciao,condizione);
 return Action.ERROR;


 }

 }

 and into jsp page:

 %out.print(request.getParameter(ciao))%

 but it doesn't work
 --
 View this message in context:
 http://www.nabble.com/System.out-into-interceptor-tp22535922p22541213.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



 -
 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/System.out-into-interceptor-tp22535922p22544593.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



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



Re: Type conversion exceptions

2009-03-16 Thread ryangr

Yes, I have it listed in the xwork-conversion.properties file as such:

com.rjssoft.webdocs.setting.SettingList=com.rjssoft.webdocs.converter.SettingListConverter

Ryan



Lukasz Lenart wrote:
 
 
 It's strange but anyway you should be able to use Struts2 / XWork2
 convertion mechanism, did you setup xwork-conversion.properties file
 as mentioned in documentation [1]?
 
 [1]
 http://struts.apache.org/2.x/docs/type-conversion.html#TypeConversion-ASimpleExample
 
 
 Regards
 -- 
 Lukasz
 http://www.lenart.org.pl/
 
 -
 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/Type-conversion-exceptions-tp22497261p22546980.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: Type conversion exceptions

2009-03-16 Thread Lukasz Lenart
2009/3/16 ryangr grigg...@gmail.com:

 Yes, I have it listed in the xwork-conversion.properties file as such:

 com.rjssoft.webdocs.setting.SettingList=com.rjssoft.webdocs.converter.SettingListConverter

And the file is in the root of your classpath (WEB-INF/classes)?


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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



Re: Need help using html:link

2009-03-16 Thread benjamin haimerl

hmm but it works in my project ;)

here is my struts-config.xml

?xml version=1.0 encoding=UTF-8?
!DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD 
Struts Configuration 1.2//EN 
http://struts.apache.org/dtds/struts-config_1_2.dtd;


struts-config
 data-sources /
 form-beans 
 /form-beans

 global-exceptions /
 global-forwards /
 action-mappings  
 action path=/displaysearchpage

 type=com.yourcompany.struts.action.DisplaySearchNameAction
 parameter=methodtocall
 forward  name=batch path=/testName.jsp
 /forward
/action
 /action-mappings

 message-resources 
parameter=com.yourcompany.struts.ApplicationResources /

/struts-config

MyAction:

package com.yourcompany.struts.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.yourcompany.struts.form.TestNameForm;

public class DisplaySearchNameAction extends Action {
  
   public ActionForward execute(ActionMapping mapping, ActionForm form,

   HttpServletRequest request, HttpServletResponse response) {
   return mapping.findForward(batch);
   }

}

MyJSP:

%@ taglib uri=http://struts.apache.org/tags-html; prefix=html%
BR
BR
html:link action=displaysearchpage.do?methodtocall=searchAcct  
   link1

/html:link
BR
BR
html:link action=displaysearchpage.do?methodtocall=searchBatch 
link2
/html:link

Generated HTML output:

BR 
BR 
a href=/Test/displaysearchpage.do?methodtocall=searchAcctlink1/a 
BR 
BR 
a href=/Test/displaysearchpage.do?methodtocall=searchBatchlink2/a 




(BTW: my context name is Test)

When i start this project
the index.jsp displays the 2 links,

clicking one of them leads me to:
http://localhost:8080/Test/displaysearchpage.do

the action forwards to: /WebRoot/testName.jsp (next to the WEB-INF Folder)
this page will be loaded well ..


it should work...
becaus it does on my side ;)




hermann.x@jpmchase.com wrote:

Benjamin,

When I click on link, it reloads the same (welcome.jsp) page.  It doesn't 
go to an empty page or go to an 404 error page.


I added logging to my action classes and it looks like the classes are 
even being called.  This leads me to believe that the configuration is not 
correct... but I have looked over my config many times and I don't see 
anything wrong with it.  Any ideas?


Thanks for your help!




benjamin haimerl b-ski...@gmx.de 
03/16/2009 03:06 PM

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


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

Subject
Re: Need help using html:link






hi hermann

imho it should work..

which page will be shown when you follow the link?
just an empty page?
Then i guess your action returned null as ActionForward, or an
notConfigured forward

or did you saw an error page
for example:
http status 404 - invalid path was requestet

that means the action isnt configured (well)

add some log points to your action, to see if the class will be called
or start the tomcat in debug to step through your action
to be sure the ActionForward Object contains the correct information
if the return value is null.. you will see an empty page
without any exceptions

greetings
benjamin haimerl


hermann.x@jpmchase.com wrote:
  
I am having trouble getting two links to work. The links render properly 



  
but when I click on the links, it doesn't forward to the appropriate 

page. 
  
I am not getting any exceptions on the server either. 
What am I missing?


The jsp: 
p align = center  
 bean:message key=welcome.webtrack.info.text / 
 BR 
 BR 
 html:link action=displaysearchpage.do?methodtocall=searchAcct  
 bean:message key=welcome.searchaccounts.link.text / 
 /html:link 
 BR 
 BR 
 html:link action=displaysearchpage.do?methodtocall=searchBatch  



  
 bean:message key=welcome.searchbatch.link.text / 
 /html:link 
 /p 


The action-mapping in struts-config file:
action path=/displaysearchpage 
  type=com.bankone.adf.webtrack.actions.DisplaySearchPageAction 
  parameter=methodtocall 
  forward name=batch path=/batchsearch.jsp 
  /forward 
  forward name=welcome path=/accountsearch.jsp 
  /forward 
 /action 


The DisplaySearchPageAction class:
public ActionForward searchAcct(ActionMapping mapping, ActionForm form, 
HttpServletRequest request, HttpServletResponse response) 
throws Exception { 
AccountSearchCriteriaForm acctSearch = new 
AccountSearchCriteriaForm(); 
 
request.setAttribute(accountSearchCriteriaForm, acctSearch); 
return mapping.findForward(welcome); 
} 

public ActionForward searchBatch(ActionMapping mapping, ActionForm form, 



  
HttpServletRequest  request, HttpServletResponse response) { 

Re: Type conversion exceptions

2009-03-16 Thread ryangr

Yes.

Hence why I'm confused! :confused:

:-D

Ryan


Lukasz Lenart wrote:
 
 2009/3/16 ryangr grigg...@gmail.com:

 Yes, I have it listed in the xwork-conversion.properties file as such:

 com.rjssoft.webdocs.setting.SettingList=com.rjssoft.webdocs.converter.SettingListConverter
 
 And the file is in the root of your classpath (WEB-INF/classes)?
 
 
 Regards
 -- 
 Lukasz
 http://www.lenart.org.pl/
 
 -
 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/Type-conversion-exceptions-tp22497261p22547311.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 Container Security problem

2009-03-16 Thread pblatner

I have tried to do the exact thing that Jeromy suggests below with 2
packages.  And then in the web.xml specify a security constraint with the
URL pattern /protected/*.  After doing so, I am not getting the result
that I think I should be.

When issuing a request for my action at
http://localhost/MyApp/protected/HomeAction;, the container is not
intercepting and challenging me with my logon.html page.

Anyone know why this isn't working?  

The struts 2 servlet-filter pattern is /*.  It seems pretty obvious that
the struts 2 servlet filter is responding to the first part of the URL:
http://localhost/MyApp/*; and the container isn't seeing that as a secured
resource.

Am I missing a configuration pattern somewhere that tells the container to
inspect the full URL before allowing the servlet filter to process it?

My deployment environment is WebSphere 6.1.  Are there any incompatibilities
between WebSphere 6.1 and struts 2 that could be causing this?

Thanks,
Pete.


Jeromy Evans - Blue Sky Minds wrote:
 
 In struts.xml, the namespace given to your package needs be in 
 /protected as well.
 eg. package name=myPackage namespace=/protected
 Otherwise, as you've seen, it's available in the root of the 
 application's context path.
 
 I usually split my struts2 application into at least two packages:
 package name=public namespace=/ ...
 package name=secure namespace=/protected
 

-- 
View this message in context: 
http://www.nabble.com/Struts-2-Container-Security-problem-tp15571409p22547426.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 Container Security problem

2009-03-16 Thread Struts Two

There is a problem running Struts 2.1.6 on Websphere when security is enabled. 
The case happens when url is an action not a resource like jsp or html. Refer 
to JIRA WW-2642 that I opened almost a year ago.

I was hoping that Apache group can get their hands on Websphere to verify the 
issue but it seems like a distant probability as I have not heard any news on 
that for sometime.

But on the bright site, there may be some good news on this soon. As I had to 
locate WAS L3 support in person and I am working with them on this issue 
[though the pace is slow].

Also keep in mind, the same issue exists on WAS 7.0.0.1 with a slight 
variation. If this is determined to be a Websphere problem with WAS 6.1. Then I 
have a stronger case to press issue for WAS 7.0.

--- On Mon, 3/16/09, pblatner pblat...@gmail.com wrote:

 From: pblatner pblat...@gmail.com
 Subject: Re: Struts 2 Container Security problem
 To: user@struts.apache.org
 Received: Monday, March 16, 2009, 9:05 PM
 
 I have tried to do the exact thing that Jeromy suggests
 below with 2
 packages.  And then in the web.xml specify a security
 constraint with the
 URL pattern /protected/*.  After doing so, I am not
 getting the result
 that I think I should be.
 
 When issuing a request for my action at
 http://localhost/MyApp/protected/HomeAction;, the
 container is not
 intercepting and challenging me with my logon.html page.
 
 Anyone know why this isn't working?  
 
 The struts 2 servlet-filter pattern is /*..  It seems
 pretty obvious that
 the struts 2 servlet filter is responding to the first part
 of the URL:
 http://localhost/MyApp/*; and the container isn't
 seeing that as a secured
 resource.
 
 Am I missing a configuration pattern somewhere that tells
 the container to
 inspect the full URL before allowing the servlet filter to
 process it?
 
 My deployment environment is WebSphere 6.1.  Are there
 any incompatibilities
 between WebSphere 6.1 and struts 2 that could be causing
 this?
 
 Thanks,
 Pete.
 
 
 Jeromy Evans - Blue Sky Minds wrote:
  
  In struts.xml, the namespace given to your package
 needs be in 
  /protected as well.
  eg. package name=myPackage
 namespace=/protected
  Otherwise, as you've seen, it's available in the root
 of the 
  application's context path.
  
  I usually split my struts2 application into at least
 two packages:
  package name=public namespace=/ ...
  package name=secure namespace=/protected
  
 
 -- 
 View this message in context: 
 http://www.nabble.com/Struts-2-Container-Security-problem-tp15571409p22547426.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
 
 


  __
Instant Messaging, free SMS, sharing photos and more... Try the new Yahoo! 
Canada Messenger at http://ca.beta.messenger.yahoo.com/


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



Re: Type conversion exceptions

2009-03-16 Thread ryangr

Somewhere in here it appears to be losing the values because the parameter
interceptor has them then once it hits the converter they disappear:

com.opensymphony.xwork2.interceptor.ParametersInterceptor  - Setting params
settings[0].value = [ 192.168.1.1 ] settings[0].title = [ SMTP Server
Address ] 

com.opensymphony.xwork2.util.InstantiatingNullHandler  - Entering
nullPropertyValue [target=[com.rjssoft.webdocs.admin.settingact...@a6d35,
com.opensymphony.xwork2.defaulttextprovi...@e2892b], property=settings]

com.opensymphony.xwork2.util.XWorkConverter  - Property: settings

com.opensymphony.xwork2.util.XWorkConverter  - Class:
com.rjssoft.webdocs.admin.SettingAction

com.opensymphony.xwork2.util.XWorkConverter  - processing conversion file
[com/rjssoft/webdocs/admin/SettingAction-conversion.properties] [class=class
com.rjssoft.webdocs.admin.SettingAction]

com.opensymphony.xwork2.util.XWorkConverter  - 
Element_settings:com.rjssoft.webdocs.setting.Setting[treated as Class class
com.rjssoft.webdocs.setting.Setting]

com.opensymphony.xwork2.util.XWorkConverter  - converter is null for
property settings. Mapping size: 1

com.opensymphony.xwork2.util.XWorkConverter  - Element_settings:class
com.rjssoft.webdocs.setting.Setting

com.opensymphony.xwork2.util.XWorkConverter  - field-level type converter
for property [settings] = none found

com.opensymphony.xwork2.util.XWorkConverter  - Property: settings.settings

com.opensymphony.xwork2.util.XWorkConverter  - Class:
com.rjssoft.webdocs.admin.SettingAction

com.opensymphony.xwork2.util.XWorkConverter  - processing conversion file
[com/rjssoft/webdocs/admin/SettingAction-conversion.properties] [class=class
com.rjssoft.webdocs.admin.SettingAction]

com.opensymphony.xwork2.util.XWorkConverter  - 
Element_settings:com.rjssoft.webdocs.setting.Setting[treated as Class class
com.rjssoft.webdocs.setting.Setting]

com.opensymphony.xwork2.util.XWorkConverter  - converter is null for
property settings.settings. Mapping size: 1

com.opensymphony.xwork2.util.XWorkConverter  - Element_settings:class
com.rjssoft.webdocs.setting.Setting

com.opensymphony.xwork2.util.XWorkConverter  - global-level type converter
for property [settings] =
com.rjssoft.webdocs.converter.settinglistconver...@61f533

com.rjssoft.webdocs.converter.SettingListConverter  - Called
SettingListConverter.convertValue(Map, Object, Member, String, Object,
Class)

com.rjssoft.webdocs.converter.SettingListConverter  - target:
com.rjssoft.webdocs.admin.settingact...@a6d35

com.rjssoft.webdocs.converter.SettingListConverter  - member: public void
com.rjssoft.webdocs.admin.SettingAction.setSettings(com.rjssoft.webdocs.setting.SettingList)

com.rjssoft.webdocs.converter.SettingListConverter  - propertyName: settings

com.rjssoft.webdocs.converter.SettingListConverter  - value
(java.util.ArrayList): []

com.rjssoft.webdocs.converter.SettingListConverter  - toType: class
com.rjssoft.webdocs.setting.SettingList

com.rjssoft.webdocs.converter.SettingListConverter  - Called
SettingListConverter.convertValue(Map, Object, Class)

com.rjssoft.webdocs.converter.SettingListConverter  - context:
ognl.ognlcont...@eb75affa

com.rjssoft.webdocs.converter.SettingListConverter  - o
(java.util.ArrayList): []

com.rjssoft.webdocs.converter.SettingListConverter  - toClass: class
com.rjssoft.webdocs.setting.SettingList

-- 
View this message in context: 
http://www.nabble.com/Type-conversion-exceptions-tp22497261p22548129.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