Re: Struts2, convention plugin, websphere 6.1

2010-11-18 Thread Li Ying
Everything submit from the client side, are passed as String.

So you can't take object instance as your parameter.

You need take the ids of these objects as parameter, and load object
by the ids by you self.


2010/11/18 Harsh C hchau...@gmail.com:
 I think that is probably what it was. Basically in my action, I had a list
 of model objects (modelList) and a model object (selectedModel).

 I changed the Model type object selectedModel to String type selectedModelId
 and things work fine now.

 Now my question is, if I had a checkboxlist backed by a list of Model
 objects, and upon checking some models, I wanted a list of selectedModel
 objects, is there a way in struts to do it?

 Thanks,
 HC

 On Wed, Nov 17, 2010 at 11:47 AM, Dave Newton davelnew...@gmail.com wrote:

 Could also be a type conversion error.
 On Nov 17, 2010 2:46 PM, Harsh C hchau...@gmail.com wrote:
  So, result input is some kind of default result that struts sends a
 user
  to?
 
  Is validation turned on by default, as I did not specify any validation?
 If
  so, how can I turn it off?
 
  Thanks,
  HC
 
  On Wed, Nov 17, 2010 at 11:39 AM, Dave Newton davelnew...@gmail.com
 wrote:
 
  Failed validation will send user back to the input result.
 
  Dave
  On Nov 17, 2010 2:29 PM, Harsh C hchau...@gmail.com wrote:
   Hi,
  
   I have an input page which has a checkbox list in a form. Clicking
 submit
   takes the user to a 2nd JSP.
   The problem is that when I don't select a checkbox and click on
 submit,
 I
   get to the output page, of course no value is displayed on the output
  page
   though.
   But if I select a checkbox and click submit, I get an error saying
  
   No result defined for action .action.ModelHomeAction and result
 input
   I just started with struts and don't really know why it is looking for
  the
   result input. I would appreciate any help with this.
  
   Relevant code is below.
  
   input.jsp
   s:form method=post action=modelUpload
   s:checkboxlist name=selectedModel list=modelList
 listKey=modelId
   listValue=modelName/
   s:submit/s:submit
   /s:form
  
   output.jsp
  
   s:property value=selectedModel/
  
   Action
   private ArrayListModel modelList;
   private Model selectedModel = new Model();
  
   public ArrayListModel getModelList() {
   FrameworkHandler handler = new FrameworkHandler();
   return handler.getModels();
   }
  
   public void setModelList(ArrayListModel modelList) {
   this.modelList = modelList;
   }
  
   public Model getSelectedModel() {
   return selectedModel;
   }
  
   public void setSelectedModel(Model selectedModel) {
   this.selectedModel = selectedModel;
   }
  
   public String execute() throws Exception {
   LOG.debug(Model Home Action);
   return SUCCESS;
   }
  
   public String upload() throws Exception{
   return SUCCESS;
   }
  
   struts.xml
  
   action name=modelHome class=.action.ModelHomeAction
   method=execute
   result name=success/jsp/input.jsp/result
   /action
  
   action name=modelUpload class=.action.ModelHomeAction
   method=upload
   result name=success/jsp/output.jsp/result
   /action
 
 
 
 
  --
  *Thanks,
  Harsh*




 --
 *Thanks,
 Harsh*


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



Re: Struts2, convention plugin, websphere 6.1

2010-11-18 Thread Aaron Brown
Gently bringing this thread back to the topic in the subject line...

Does anyone have any ideas about why my WebSphere 6.1 server would be
ignoring the convention plugin and not loading any of my struts2
annotations into the context?

I did see some references in the websphere patch info to fixing some
broken annotation processing with respect to web services, but I'm not
using any web services in this particular app (SOAP, etc.). Is this a
patch that I need to apply anyway? I hadn't done it yet since it's
clear my server IS processing annotations for other things like
hibernate and spring (@Autowire, for example, works like a charm).

Anyway, I'm stumped.

-- 
Aaron Brown : aa...@thebrownproject.com

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



Re: Struts2, convention plugin, websphere 6.1

2010-11-18 Thread Dave Newton
I'd backtrack and deploy a simple app with only a single annotated action
and the convention plugin and start from there; it's loading the plugin. I'd
also check the configuration parameter reference:

http://struts.apache.org/2.1.8/docs/convention-plugin.html#ConventionPlugin-Configurationreference

I also always put the action classes in a package whose name ends in
actions; I vaguely remember having an issue if it was named anything else,
but I could be *completely* misremembering that.

Dave
http://struts.apache.org/2.1.8/docs/convention-plugin.html#ConventionPlugin-Configurationreference
On Thu, Nov 18, 2010 at 9:41 AM, Aaron Brown aa...@thebrownproject.comwrote:

 Gently bringing this thread back to the topic in the subject line...

 Does anyone have any ideas about why my WebSphere 6.1 server would be
 ignoring the convention plugin and not loading any of my struts2
 annotations into the context?

 I did see some references in the websphere patch info to fixing some
 broken annotation processing with respect to web services, but I'm not
 using any web services in this particular app (SOAP, etc.). Is this a
 patch that I need to apply anyway? I hadn't done it yet since it's
 clear my server IS processing annotations for other things like
 hibernate and spring (@Autowire, for example, works like a charm).

 Anyway, I'm stumped.

 --
 Aaron Brown : aa...@thebrownproject.com

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




Re: Struts2, convention plugin, websphere 6.1

2010-11-17 Thread Dave Newton
Without further information it'll be difficult to help; is devMode
turned on? Do you have DEBUG set for *everything*, or just s2
packages, or xwork, or...? It shouldn't matter, but do you have the
WebFear filter compatibility flag set (or don't need it due to patch
level)?

Dave

On Wed, Nov 17, 2010 at 11:56 AM, Aaron Brown aa...@thebrownproject.com wrote:
 I've been working on implementing Struts 2.1.8 on WebSphere 6.1 and
 I'm having trouble with the convention plugin and annotation-based
 configuration. It appears that none of my struts configs are being
 scanned and/or processed from the annotations.  Here's what I know:

 1) Struts2 and WebSphere is an ugly partnership. There are lots of
 outstanding issues, so I'm wondering if this particular one has been
 solved and if there's anything I can do.

 2) I know WebSphere is scanning other annotations, since my
 spring/hibernate annotations are working as expected.

 3) Config browser tells me that my annotated packages/namespaces have
 no actions defined. When I load the action configs into .xml files
 instead, the actions are correctly loaded and working.

 4) I tried tossing in some extra struts convention constants just to
 prod things, but no help:
 struts.convention.action.disableScanning = false
 struts.convention.action.packages = com.mycompany.myapp.action

 5) This app with all its annotations is working perfectly in Tomcat,
 just not in WebSphere.

 6) I have log4j set to DEBUG and I don't see any information about
 actions being defined by the convention plugin - it's as if it isn't
 even executing.

 I have a workaround - the xml config works - but would prefer to use
 annotations if I can. Anyone else run into this and solved it?

 thanks,
  - Aaron

 --
 Aaron Brown : aa...@thebrownproject.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: Struts2, convention plugin, websphere 6.1

2010-11-17 Thread Aaron Brown
Thanks for the quick reply.

Here is my full struts.properties:
= = = = = = = = = = = = = = = = = =
struts.enable.DynamicMethodInvocation = true
struts.devMode = true
struts.convention.classes.reload = true
struts.ui.theme = simple

struts.convention.action.disableScanning = false
struts.convention.action.packages = com.mycompany.myapp.action
= = = = = = = = = = = = = = = = = =

Here are the relevant snippets from log4j.xml:
   !-- Appenders --
   appender name=console class=org.apache.log4j.ConsoleAppender
   param name=Threshold value=DEBUG/
   param name=Target value=System.out /
   layout class=org.apache.log4j.PatternLayout
   param name=ConversionPattern value=%-5p: %c - %m%n /
   /layout
   /appender

   !-- 3rdparty Loggers --
   logger name=org.springframework
   level value=warn /
   /logger
   logger name=org.apache.struts2
   level value=debug /
   /logger
   logger name=com.opensymphony.xwork2
   level value=debug /
   /logger

   !-- Root Logger --
   root
   priority value=debug /
   appender-ref ref=console /
   appender-ref ref=logfile /
   /root

And yes, I have the special filter flag set in websphere config. I
believe that was patched at websphere 13, and I'm patched to 11 at the
moment. Struts is working - I can see the config-browser/index.action
for example, and when I use xml config all my normal actions are
behaving normally. So the websphere filter issue doesn't appear to be
the problem in this case. Just for fun, at the end of this message,
I'll append a copy of the console log that websphere generates when it
loads my app.

 - Aaron

On Wed, Nov 17, 2010 at 12:17 PM, Dave Newton davelnew...@gmail.com wrote:
 Without further information it'll be difficult to help; is devMode
 turned on? Do you have DEBUG set for *everything*, or just s2
 packages, or xwork, or...? It shouldn't matter, but do you have the
 WebFear filter compatibility flag set (or don't need it due to patch
 level)?


-- 
Aaron Brown : aa...@thebrownproject.com

debug log follows, sorry for any text wrapping. This log opens with
the server completing its startup cycle (open for e-business). I
then requested a url to an action configured with annotations, causing
the app server to load all the app contexts. At the end of the log you
can see struts processing that as an unknown action and dealing with
it.

[11/17/10 13:32:41:731 EST] 000a WsServerImpl  A   WSVR0001I:
Server server1 open for e-business
[11/17/10 13:32:56:715 EST] 0019 SystemOut O DEBUG:
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider -
Loading action configurations from: struts-default.xml
[11/17/10 13:32:56:747 EST] 0019 SystemOut O DEBUG:
com.opensymphony.xwork2.util.FileManager - Creating revision for URL:
wsjar:file:/C:/Program
Files/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/nw897628Node01Cell/tsbOne.ear/tsb.war/WEB-INF/lib/struts2-core-2.1.8.jar!/struts-default.xml
[11/17/10 13:32:56:825 EST] 0019 SystemOut O DEBUG:
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider -
Loaded action configuration from: struts-default.xml
[11/17/10 13:32:56:856 EST] 0019 SystemOut O INFO :
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider -
Parsing configuration file [struts-default.xml]
[11/17/10 13:32:56:856 EST] 0019 SystemOut O DEBUG:
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider -
Loaded type: name:xwork impl:com.opensymphony.xwork2.ObjectFactory
[11/17/10 13:32:56:872 EST] 0019 SystemOut O DEBUG:
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider -
Loaded type:com.opensymphony.xwork2.ObjectFactory name:struts
impl:org.apache.struts2.impl.StrutsObjectFactory
[11/17/10 13:32:56:872 EST] 0019 SystemOut O DEBUG:
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider -
Loaded type:com.opensymphony.xwork2.ActionProxyFactory name:xwork
impl:com.opensymphony.xwork2.DefaultActionProxyFactory
[11/17/10 13:32:56:887 EST] 0019 SystemOut O DEBUG:
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider -
Loaded type:com.opensymphony.xwork2.ActionProxyFactory name:struts
impl:org.apache.struts2.impl.StrutsActionProxyFactory
[11/17/10 13:32:56:903 EST] 0019 SystemOut O DEBUG:
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider -
Loaded type:com.opensymphony.xwork2.conversion.ObjectTypeDeterminer
name:tiger 
impl:com.opensymphony.xwork2.conversion.impl.DefaultObjectTypeDeterminer
[11/17/10 13:32:56:903 EST] 0019 SystemOut O DEBUG:
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider -
Loaded type:com.opensymphony.xwork2.conversion.ObjectTypeDeterminer
name:notiger 
impl:com.opensymphony.xwork2.conversion.impl.DefaultObjectTypeDeterminer
[11/17/10 13:32:56:903 EST] 0019 SystemOut O DEBUG:
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider -
Loaded 

Re: Struts2, convention plugin, websphere 6.1

2010-11-17 Thread Harsh C
Hi,

I have an input page which has a checkbox list in a form. Clicking submit
takes the user to a 2nd JSP.
The problem is that when I don't select a checkbox and click on submit, I
get to the output page, of course no value is displayed on the output page
though.
But if I select a checkbox and click submit, I get an error saying

No result defined for action .action.ModelHomeAction and result input
I just started with struts and don't really know why it is looking for the
result input. I would appreciate any help with this.

Relevant code is below.

input.jsp
 s:form method=post action=modelUpload
 s:checkboxlist name=selectedModel list=modelList listKey=modelId
listValue=modelName/
  s:submit/s:submit
 /s:form

output.jsp

s:property value=selectedModel/

Action
 private ArrayListModel modelList;
 private Model selectedModel = new Model();

 public ArrayListModel getModelList() {
 FrameworkHandler handler = new FrameworkHandler();
  return handler.getModels();
 }

 public void setModelList(ArrayListModel modelList) {
 this.modelList = modelList;
 }

 public Model getSelectedModel() {
 return selectedModel;
 }

 public void setSelectedModel(Model selectedModel) {
 this.selectedModel = selectedModel;
 }

 public String execute() throws Exception {
  LOG.debug(Model Home Action);
 return SUCCESS;
 }

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

struts.xml

  action name=modelHome class=.action.ModelHomeAction
method=execute
result name=success/jsp/input.jsp/result
  /action

  action name=modelUpload class=.action.ModelHomeAction
method=upload
result name=success/jsp/output.jsp/result
  /action


Re: Struts2, convention plugin, websphere 6.1

2010-11-17 Thread Dave Newton
Failed validation will send user back to the input result.

Dave
 On Nov 17, 2010 2:29 PM, Harsh C hchau...@gmail.com wrote:
 Hi,

 I have an input page which has a checkbox list in a form. Clicking submit
 takes the user to a 2nd JSP.
 The problem is that when I don't select a checkbox and click on submit, I
 get to the output page, of course no value is displayed on the output page
 though.
 But if I select a checkbox and click submit, I get an error saying

 No result defined for action .action.ModelHomeAction and result input
 I just started with struts and don't really know why it is looking for the
 result input. I would appreciate any help with this.

 Relevant code is below.

 input.jsp
 s:form method=post action=modelUpload
 s:checkboxlist name=selectedModel list=modelList listKey=modelId
 listValue=modelName/
 s:submit/s:submit
 /s:form

 output.jsp

 s:property value=selectedModel/

 Action
 private ArrayListModel modelList;
 private Model selectedModel = new Model();

 public ArrayListModel getModelList() {
 FrameworkHandler handler = new FrameworkHandler();
 return handler.getModels();
 }

 public void setModelList(ArrayListModel modelList) {
 this.modelList = modelList;
 }

 public Model getSelectedModel() {
 return selectedModel;
 }

 public void setSelectedModel(Model selectedModel) {
 this.selectedModel = selectedModel;
 }

 public String execute() throws Exception {
 LOG.debug(Model Home Action);
 return SUCCESS;
 }

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

 struts.xml

 action name=modelHome class=.action.ModelHomeAction
 method=execute
 result name=success/jsp/input.jsp/result
 /action

 action name=modelUpload class=.action.ModelHomeAction
 method=upload
 result name=success/jsp/output.jsp/result
 /action


Re: Struts2, convention plugin, websphere 6.1

2010-11-17 Thread Harsh C
So, result input is some kind of default result that struts sends a user
to?

Is validation turned on by default, as I did not specify any validation? If
so, how can I turn it off?

Thanks,
HC

On Wed, Nov 17, 2010 at 11:39 AM, Dave Newton davelnew...@gmail.com wrote:

 Failed validation will send user back to the input result.

 Dave
  On Nov 17, 2010 2:29 PM, Harsh C hchau...@gmail.com wrote:
  Hi,
 
  I have an input page which has a checkbox list in a form. Clicking submit
  takes the user to a 2nd JSP.
  The problem is that when I don't select a checkbox and click on submit, I
  get to the output page, of course no value is displayed on the output
 page
  though.
  But if I select a checkbox and click submit, I get an error saying
 
  No result defined for action .action.ModelHomeAction and result input
  I just started with struts and don't really know why it is looking for
 the
  result input. I would appreciate any help with this.
 
  Relevant code is below.
 
  input.jsp
  s:form method=post action=modelUpload
  s:checkboxlist name=selectedModel list=modelList listKey=modelId
  listValue=modelName/
  s:submit/s:submit
  /s:form
 
  output.jsp
 
  s:property value=selectedModel/
 
  Action
  private ArrayListModel modelList;
  private Model selectedModel = new Model();
 
  public ArrayListModel getModelList() {
  FrameworkHandler handler = new FrameworkHandler();
  return handler.getModels();
  }
 
  public void setModelList(ArrayListModel modelList) {
  this.modelList = modelList;
  }
 
  public Model getSelectedModel() {
  return selectedModel;
  }
 
  public void setSelectedModel(Model selectedModel) {
  this.selectedModel = selectedModel;
  }
 
  public String execute() throws Exception {
  LOG.debug(Model Home Action);
  return SUCCESS;
  }
 
  public String upload() throws Exception{
  return SUCCESS;
  }
 
  struts.xml
 
  action name=modelHome class=.action.ModelHomeAction
  method=execute
  result name=success/jsp/input.jsp/result
  /action
 
  action name=modelUpload class=.action.ModelHomeAction
  method=upload
  result name=success/jsp/output.jsp/result
  /action




-- 
*Thanks,
Harsh*


Re: Struts2, convention plugin, websphere 6.1

2010-11-17 Thread Dave Newton
Could also be a type conversion error.
On Nov 17, 2010 2:46 PM, Harsh C hchau...@gmail.com wrote:
 So, result input is some kind of default result that struts sends a user
 to?

 Is validation turned on by default, as I did not specify any validation?
If
 so, how can I turn it off?

 Thanks,
 HC

 On Wed, Nov 17, 2010 at 11:39 AM, Dave Newton davelnew...@gmail.com
wrote:

 Failed validation will send user back to the input result.

 Dave
 On Nov 17, 2010 2:29 PM, Harsh C hchau...@gmail.com wrote:
  Hi,
 
  I have an input page which has a checkbox list in a form. Clicking
submit
  takes the user to a 2nd JSP.
  The problem is that when I don't select a checkbox and click on submit,
I
  get to the output page, of course no value is displayed on the output
 page
  though.
  But if I select a checkbox and click submit, I get an error saying
 
  No result defined for action .action.ModelHomeAction and result
input
  I just started with struts and don't really know why it is looking for
 the
  result input. I would appreciate any help with this.
 
  Relevant code is below.
 
  input.jsp
  s:form method=post action=modelUpload
  s:checkboxlist name=selectedModel list=modelList listKey=modelId
  listValue=modelName/
  s:submit/s:submit
  /s:form
 
  output.jsp
 
  s:property value=selectedModel/
 
  Action
  private ArrayListModel modelList;
  private Model selectedModel = new Model();
 
  public ArrayListModel getModelList() {
  FrameworkHandler handler = new FrameworkHandler();
  return handler.getModels();
  }
 
  public void setModelList(ArrayListModel modelList) {
  this.modelList = modelList;
  }
 
  public Model getSelectedModel() {
  return selectedModel;
  }
 
  public void setSelectedModel(Model selectedModel) {
  this.selectedModel = selectedModel;
  }
 
  public String execute() throws Exception {
  LOG.debug(Model Home Action);
  return SUCCESS;
  }
 
  public String upload() throws Exception{
  return SUCCESS;
  }
 
  struts.xml
 
  action name=modelHome class=.action.ModelHomeAction
  method=execute
  result name=success/jsp/input.jsp/result
  /action
 
  action name=modelUpload class=.action.ModelHomeAction
  method=upload
  result name=success/jsp/output.jsp/result
  /action




 --
 *Thanks,
 Harsh*


Re: Struts2, convention plugin, websphere 6.1

2010-11-17 Thread Harsh C
I think that is probably what it was. Basically in my action, I had a list
of model objects (modelList) and a model object (selectedModel).

I changed the Model type object selectedModel to String type selectedModelId
and things work fine now.

Now my question is, if I had a checkboxlist backed by a list of Model
objects, and upon checking some models, I wanted a list of selectedModel
objects, is there a way in struts to do it?

Thanks,
HC

On Wed, Nov 17, 2010 at 11:47 AM, Dave Newton davelnew...@gmail.com wrote:

 Could also be a type conversion error.
 On Nov 17, 2010 2:46 PM, Harsh C hchau...@gmail.com wrote:
  So, result input is some kind of default result that struts sends a
 user
  to?
 
  Is validation turned on by default, as I did not specify any validation?
 If
  so, how can I turn it off?
 
  Thanks,
  HC
 
  On Wed, Nov 17, 2010 at 11:39 AM, Dave Newton davelnew...@gmail.com
 wrote:
 
  Failed validation will send user back to the input result.
 
  Dave
  On Nov 17, 2010 2:29 PM, Harsh C hchau...@gmail.com wrote:
   Hi,
  
   I have an input page which has a checkbox list in a form. Clicking
 submit
   takes the user to a 2nd JSP.
   The problem is that when I don't select a checkbox and click on
 submit,
 I
   get to the output page, of course no value is displayed on the output
  page
   though.
   But if I select a checkbox and click submit, I get an error saying
  
   No result defined for action .action.ModelHomeAction and result
 input
   I just started with struts and don't really know why it is looking for
  the
   result input. I would appreciate any help with this.
  
   Relevant code is below.
  
   input.jsp
   s:form method=post action=modelUpload
   s:checkboxlist name=selectedModel list=modelList
 listKey=modelId
   listValue=modelName/
   s:submit/s:submit
   /s:form
  
   output.jsp
  
   s:property value=selectedModel/
  
   Action
   private ArrayListModel modelList;
   private Model selectedModel = new Model();
  
   public ArrayListModel getModelList() {
   FrameworkHandler handler = new FrameworkHandler();
   return handler.getModels();
   }
  
   public void setModelList(ArrayListModel modelList) {
   this.modelList = modelList;
   }
  
   public Model getSelectedModel() {
   return selectedModel;
   }
  
   public void setSelectedModel(Model selectedModel) {
   this.selectedModel = selectedModel;
   }
  
   public String execute() throws Exception {
   LOG.debug(Model Home Action);
   return SUCCESS;
   }
  
   public String upload() throws Exception{
   return SUCCESS;
   }
  
   struts.xml
  
   action name=modelHome class=.action.ModelHomeAction
   method=execute
   result name=success/jsp/input.jsp/result
   /action
  
   action name=modelUpload class=.action.ModelHomeAction
   method=upload
   result name=success/jsp/output.jsp/result
   /action
 
 
 
 
  --
  *Thanks,
  Harsh*




-- 
*Thanks,
Harsh*


Re: Struts2, convention plugin, websphere 6.1

2010-11-17 Thread Harsh C
I am using Struts 2.2.1 and would like to get some AJAX functionality in my
app, specifically, I would like to use Dojo. The Dojo plugin was deprecated
for this release, is there some good documentation/tutorials for getting
into Struts 2.2.1 with DOJO?


Re: Struts2, convention plugin, websphere 6.1

2010-11-17 Thread Dave Newton
Please start new threads for new questions.

There's a jquery plugin, or you can use any framework in its raw form. The
latter is almost always my personal recommendation so the JavaScript can be
optimized for the application.

Dave
 On Nov 17, 2010 4:30 PM, Harsh C hchau...@gmail.com wrote: