Re: Running a prepare method before the assigned action method

2008-03-25 Thread meeboo

Still no solution to this problem. How come parameters in actions with
wildcards (for example myapp/modelObject/*) aren't parsed in the prepare
method? They work fine when I parse them in my assigned action method :(


meeboo wrote:
 
 Hey again
 
 I'm posting via nabble, and it seems to strip out my wildcards, basically
 my action looks like this now
 
 action name=update/modelObject/*
 class=net.schemer.web.ObjectModelActions
  interceptor-ref name=paramsPrepareParamsStack/   
   param name=  id   { 1 } 
 result/models/objectModel/update.jsp/result
 /action
 
 Hopefully this is viewable. 
 
 
 newton.dave wrote:
 
 --- meeboo [EMAIL PROTECTED] wrote:
 won't work with a wildcard parameter mapping Dave
 
 action name=update/modelObject/*
 class=net.myapp.web.ModelObjectActions
 method=update
 
 Your first post didn't have a wildcard mapping.
 
 The parameter simply isn't parsed in the prepare method unless it's in
 the
 form of update/modelObject.action?id=22
 
 Do you mean parsed by the parameter interceptor?
 
 this is what I'm currently doing
 update/modelObject/22.action
 
 The parameter is parsed in the update method, but not in the prepare
 method
 
 Are you using the standard action mapper? Any plugins?
 
 The mapping you posted in your follow-up message did not come through
 properly; please make sure you're sending plain-text messages. This is
 what I
 saw:
 
 action name=update/user/* 
 class=net.myapp.web.UserActions
  interceptor-ref name=paramsPrepareParamsStack/ 
  {1}
  result/models/user/update.jsp/result
 /action
 
 I don't really know what you're trying to do or how you're going about
 trying
 to do it.
 
 Dave
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Running-a-prepare-method-before-the-assigned-action-method-tp16219260p16274676.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Running a prepare method before the assigned action method

2008-03-22 Thread meeboo

Hi all

I have a class for several actions and each action is mapped to a method,
like this:

action name=update/modelObject 
   class=net.myapp.web.modelObjectActions
   method=update
result/index.jsp/result
/action

The above action will fire when a form is submitted and the modelObject
properties are populated via the form fields. Now that I want is to invoke a
prepare method before the update method so that I first can read the model
object from the database and then populate its fields. I did implement
preparable in modelObjectActions but then the prepare method will be invoked
before all actions in that class, I want it to be invoked just for this
specific action. 

Any ideas?

Thanks
-- 
View this message in context: 
http://www.nabble.com/Running-a-prepare-method-before-the-assigned-action-method-tp16219260p16219260.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Running a prepare method before the assigned action method

2008-03-22 Thread meeboo

Ahh nevermind the first mail, I managed to work around it. 

I still have a problem of not being able to access parameters via my prepare
method though. Here's my action class:

public class UserActions extends StrutsSupport implements Preparable {

   public void prepare()
   {
if(id != null) //property is located in superclass StrutsSupport
user= appManager.readUser(Long.valueOf(id));
   }

}

and the struts mapping:
action name=update/user/* 
class=net.myapp.web.UserActions
 interceptor-ref name=paramsPrepareParamsStack/ 
 {1}
 result/models/user/update.jsp/result
/action

The whole flow is that when you access the above action the user object is
read and its values populate the form in update.jsp. But the id property is
never set so the form is never populated. I even tried setting
paramsPrepareParamsStack as the default stack but with no luck. 


meeboo wrote:
 
 Hi all
 
 I have a class for several actions and each action is mapped to a method,
 like this:
 
 action name=update/modelObject 
class=net.myapp.web.modelObjectActions
method=update
 result/index.jsp/result
 /action
 
 The above action will fire when a form is submitted and the modelObject
 properties are populated via the form fields. Now that I want is to invoke
 a prepare method before the update method so that I first can read the
 model object from the database and then populate its fields. I did
 implement preparable in modelObjectActions but then the prepare method
 will be invoked before all actions in that class, I want it to be invoked
 just for this specific action. 
 
 Any ideas?
 
 Thanks
 

-- 
View this message in context: 
http://www.nabble.com/Running-a-prepare-method-before-the-assigned-action-method-tp16219260p16220742.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Running a prepare method before the assigned action method

2008-03-22 Thread meeboo

It seems as if the preparable method can't parse parameters if they are in
the following format

update/modelObject/10.action (where 10.action is the primary key)

where as it works fine when using action urls like this
update/modelObject?10.action

Is this expected behavior? 


meeboo wrote:
 
 Hi all
 
 I have a class for several actions and each action is mapped to a method,
 like this:
 
 action name=update/modelObject 
class=net.myapp.web.modelObjectActions
method=update
 result/index.jsp/result
 /action
 
 The above action will fire when a form is submitted and the modelObject
 properties are populated via the form fields. Now that I want is to invoke
 a prepare method before the update method so that I first can read the
 model object from the database and then populate its fields. I did
 implement preparable in modelObjectActions but then the prepare method
 will be invoked before all actions in that class, I want it to be invoked
 just for this specific action. 
 
 Any ideas?
 
 Thanks
 

-- 
View this message in context: 
http://www.nabble.com/Running-a-prepare-method-before-the-assigned-action-method-tp16219260p16222867.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Running a prepare method before the assigned action method

2008-03-22 Thread meeboo

won't work with a wildcard parameter mapping Dave

action name=update/modelObject/*
class=net.myapp.web.ModelObjectActions
method=update

The parameter simply isn't parsed in the prepare method unless it's in the
form of update/modelObject.action?id=22

this is what I'm currently doing
update/modelObject/22.action

The parameter is parsed in the update method, but not in the prepare method
(i've tried using the 


newton.dave wrote:
 
 --- meeboo [EMAIL PROTECTED] wrote:
 I have a class for several actions and each action is mapped to a method,
 like this:
 
 action name=update/modelObject 
class=net.myapp.web.modelObjectActions
method=update
 result/index.jsp/result
 /action
 
 The above action will fire when a form is submitted and the modelObject
 properties are populated via the form fields. Now that I want is to
 invoke
 a
 prepare method before the update method so that I first can read the
 model
 object from the database and then populate its fields. I did implement
 preparable in modelObjectActions but then the prepare method will be
 invoked
 before all actions in that class, I want it to be invoked just for this
 specific action. 
 
 Any ideas?
 
 prepareUpdate.
 
 http://struts.apache.org/2.x/docs/prepare-interceptor.html
 
 Dave
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Running-a-prepare-method-before-the-assigned-action-method-tp16219260p16225398.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Running a prepare method before the assigned action method

2008-03-22 Thread meeboo

Hey again

I'm posting via nabble, and it seems to strip out my wildcards, basically my
action looks like this now

action name=update/modelObject/*
class=net.schemer.web.ObjectModelActions
 interceptor-ref name=paramsPrepareParamsStack/ 
  param name=  id   { 1 } 
result/models/objectModel/update.jsp/result
/action

Hopefully this is viewable. 


newton.dave wrote:
 
 --- meeboo [EMAIL PROTECTED] wrote:
 won't work with a wildcard parameter mapping Dave
 
 action name=update/modelObject/*
 class=net.myapp.web.ModelObjectActions
 method=update
 
 Your first post didn't have a wildcard mapping.
 
 The parameter simply isn't parsed in the prepare method unless it's in
 the
 form of update/modelObject.action?id=22
 
 Do you mean parsed by the parameter interceptor?
 
 this is what I'm currently doing
 update/modelObject/22.action
 
 The parameter is parsed in the update method, but not in the prepare
 method
 
 Are you using the standard action mapper? Any plugins?
 
 The mapping you posted in your follow-up message did not come through
 properly; please make sure you're sending plain-text messages. This is
 what I
 saw:
 
 action name=update/user/* 
  class=net.myapp.web.UserActions
  interceptor-ref name=paramsPrepareParamsStack/  
  {1}
  result/models/user/update.jsp/result
 /action
 
 I don't really know what you're trying to do or how you're going about
 trying
 to do it.
 
 Dave
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Running-a-prepare-method-before-the-assigned-action-method-tp16219260p16227199.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: s:date

2008-03-19 Thread meeboo

Thanks for the reply. I did try nesting a s:date tag within a s:url but
no dice. This is what I tried:

s:url action=date/
s:date name=starts /
/s:url

I didn't even think this would, but it actually did render the following
result
http://localhost:8080/myapp/2007-05-12 day/ 

I was expecting http://localhost:8080/myapp/day/2007-05-12.action

Also I noticed that there seems to be a bug with the var attribute in
s:url (it doesn't work at all)

Maybe someone can shed some light on these issues? 



Alexis Pigeon wrote:
 
 Hi,
 
 On 18/03/2008, meeboo [EMAIL PROTECTED] wrote:

  Has anyone had success with s:date / and setting the
 struts.date.format
  property?

  meeboo wrote:
  
   Hi all
  
   I have set my struts.date.format properties but they seem to have no
   effect at all.
 
 [snip]
 
   I've also noticed that since you can't nest S2 tags the s:date tag
   becomes pretty useless because you can't use it within s:url
 actions. Is
   there a way around this?
 
 I can't help you with your issue about setting the struts.date.format
 property (I never needed the s:date tag so far), but as for
 nesting S2 tags, most often it can easily be done using the
 s:param tag. See the examples in the tag reference [1].
 
 HTH,
 alexis
 
 [1] http://struts.apache.org/2.0.11/docs/url.html
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/%3Cs%3Adate%3E-tp16084868p16149006.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: s:date

2008-03-18 Thread meeboo

Has anyone had success with s:date / and setting the struts.date.format
property?


meeboo wrote:
 
 Hi all
 
 I have set my struts.date.format properties but they seem to have no
 effect at all. The set value is 
 struts.date.format=-MM-dd but when using the s:date tag the format
 is for example Jan 14, 2008 8:00:00 AM. All my other properties take
 effect so there's no problem with setting other values via the
 struts.properties file.
 
 In this case am trying to print a java.util.Date object with s:date
 name=starts /. It will print out fine if I for instance use s:date
 name=myDate format=[EMAIL PROTECTED]@MY_FORMAT} /
 
 I've also noticed that since you can't nest S2 tags the s:date tag
 becomes pretty useless because you can't use it within s:url actions. Is
 there a way around this?
 
 Thanks!
 

-- 
View this message in context: 
http://www.nabble.com/%3Cs%3Adate%3E-tp16084868p16116709.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



s:date

2008-03-16 Thread meeboo

Hi all

I have set my struts.date.format properties but they seem to have no effect
at all. The set value is 
struts.date.format=-MM-dd but when using the s:date tag the format is
for example Jan 14, 2008 8:00:00 AM. All my other properties take effect
so there's no problem with setting other values via the struts.properties
file.

In this case am trying to print a java.util.Date object with s:date
name=starts /. It will print out fine if I for instance use s:date
name=myDate format=[EMAIL PROTECTED]@MY_FORMAT} /

I've also noticed that since you can't nest S2 tags the s:date tag becomes
pretty useless because you can't use it within s:url actions. Is there a
way around this?

Thanks!
-- 
View this message in context: 
http://www.nabble.com/%3Cs%3Adate%3E-tp16084868p16084868.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Struts url problem

2007-09-06 Thread meeboo


try




s:url id=url value=%{#myPath}
s:param name=solutions:property value=solution//s:param
... (other params)
/s:url 


TonyD wrote:
 
 I'm trying to use a property value into a struts url but doesn't work
 because
 I can not use the ( character) twice into a url value, could somebody
 help me?
 Thanks in advance.
 
 s:url id=url value=s:property value=mypath/
 s:param name=solutions:property value=solution//s:param
 ... (other params)
 /s:url 
 

-- 
View this message in context: 
http://www.nabble.com/Struts-url-problem-tf4391946.html#a12523309
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Struts2 - troubles with ParameterAware

2007-08-22 Thread meeboo

I think that you'll need to declare the param, something in the likes of...

action name=actionparam
class=test.ActionParam
result/ActionParam.jsp/result
{1} !-- added this --
interceptor-ref name=servlet-config /
interceptor-ref name=params/
/action

not sure though since I don't have the time to thoroughly look through the
code :p


Riccardo Mollame wrote:
 
 file set:
 
 Launch JSP page: TestActionParam.jsp
 Action: ActionParam.java
 Response JSP page: ActionParam.jsp
 Struts config file: struts.xml
 
 source code:
 
  TestActionParame.jsp **
 
 %@ taglib prefix=s uri=/struts-tags %
 html
   head
 meta http-equiv=Content-Type
 content=text/html; charset=windows-1252/
 titleTestActionParam/title
   /head
   body
 br
 center actionparam.action?par=YES test /center  
   /body
 /html
 
  ActionParam.java 
 
 package test;
 
 import com.opensymphony.xwork2.ActionSupport;
 import java.util.Map;
 import org.apache.struts2.interceptor.ParameterAware;
 
 public class ActionParam extends ActionSupport
 implements ParameterAware {
 public static final String MESSAGE = Test passed:
 ;
 private String message;
 private Map parameters;
 public String execute() throws Exception {
 String[] par =
 (String[])parameters.get(par);
 String parVal=((par!=null)?par[0]:NO);
 setMessage(MESSAGE +   + parVal);
 return success;
 }
 public void setMessage(String message){
 this.message = message;
 }
 public String getMessage(){
 return message;
 }
 public void setParameters(Map parameters) {
  this.parameters=parameters;
 }
 public Map getParameters() {
  return parameters;
 }
 }
 
 ** ActionParam.jsp ***
 
 %@ taglib prefix=s uri=/struts-tags %
 html
   head
 meta http-equiv=Content-Type
 content=text/html; charset=windows-1252/
 titleActionParam/title
   /head
   body
   h2s:property value=message//h2
  /body
 /html
 
 *** struts.xml ***
 
 !DOCTYPE struts PUBLIC
 -//Apache Software Foundation//DTD Struts
 Configuration 2.0//EN
 http://struts.apache.org/dtds/struts-2.0.dtd;
 struts
 package name=default
 extends=struts-default/package
 package name=test extends=struts-default
 action name=actionparam
 class=test.ActionParam
 result/ActionParam.jsp/result
 interceptor-ref name=servlet-config /
 interceptor-ref name=params/
 /action
 /package
 /struts
 
 **
 
 Result: passed par parameter always null ... (though
 it is actually present in the URL)
 
  WHERE'S THE DAMN PROBLEM?!? 
 
 A very discouraged Struts 2 newbie...
 
 Thanks in advance.
 
   Ric
 
 
 
   ___ 
 L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail:
 http://it.docs.yahoo.com/nowyoucan.html
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Struts2---troubles-with-ParameterAware-tf4311574.html#a12274681
Sent from the Struts - User mailing list archive at Nabble.com.


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



src.js in Struts2

2007-08-16 Thread meeboo

Hey all

I've moved all the static Dojo stuff from the Struts2 jar to an external
location, but my app constantly complains about not finding src.js - as
far as I can see this file isn't even included in the S2 lib. I've tried
googling for the file but can't seem to find it anywhere, any ideas?

Thanks!
-- 
View this message in context: 
http://www.nabble.com/src.js-in-Struts2-tf4279855.html#a12181974
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: [S2] Problems loading css files in RestfulActionMapper

2007-07-31 Thread meeboo

Try using absolute URL:s for the CSS files, it might be a workaround but it's
worked for me before.


Srinivas.N. wrote:
 
 I am using the restful mapper through a CompositeActionMapper as in
 
 constant name=struts.mapper.class
 value=org.apache.struts2.dispatcher.mapper.CompositeActionMapper/
 constant name=struts.mapper.composite value=struts,restful/ 
 
 However, the css files dont seem to be loading for any of the URLs once I
 use this mapper. I saw the same issue in another thread
 http://www.nabble.com/CompositeActionMapper-tf3433990.html#a9573608
 Someone had posted a patch for FilterDispatcher.class in that thread and
 when I tried that, URLs invoked through the struts action mapper work ok,
 but for URLs invoked through the restful syntax, the CSS files are still
 not loading.
 
 Any ideas?
 
 And on the topic of restful URLs, is there a way to make the s:url tag
 generate restful URLs?
 
 Thanks
 Srinivas
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Problems-loading-css-files-in-RestfulActionMapper-tf4182294.html#a11919918
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: S2 + REST urls

2007-07-30 Thread meeboo

At the moment we are using URLRewrite to bypass all the trouble with S2
intercepting static content (we are also not using any action extension).
But it would be even better if the filter was patched :)


Ted Husted wrote:
 
 It's possible that the use case of a an empty action extension was not
 considered when the filter was first designed. It does seem like a
 valid use case, and it may be time to patch the filter.
 
 -Ted.
 
 On 7/26/07, matihost [EMAIL PROTECTED] wrote:
 I wondering why filter dispatcher do not check existence of mapping
 returned from ActionMapper and if it doesn't exist, behave as when
 ActionMapper is null. Probably it is faster for not empty
 struts.action.extension actions.

 I found also solution to use /someName/* for struts filter dispatcher
 mapping, but i don`t want to use it.

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

-- 
View this message in context: 
http://www.nabble.com/S2-%2B-REST-urls-tf4152090.html#a11862390
Sent from the Struts - User mailing list archive at Nabble.com.


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



Accessing constants in Struts.xml

2007-07-12 Thread meeboo

Hey all

How can I access constants via my S2 mapping files? At the moment I have the
following mapping:

action name=upload class=com.myapp.web.struts.page.UploadMovie
result name=login
type=redirect${UMA_REDIRECT_URL}http://myapp:8080/app/upload.action/result
result name=success/uploadMovie.jsp/result
/action

${UMA_REDIRECT_URL} is a constant declared in UploadMovie - but I can't
access it in Struts.xml. If I on the other hand write something in the likes
of 
result name=login
type=redirect${getRedirectUrl()}http://myapp:8080/app/upload.action/result

and then return the constant via getRedirectUrl() it'll work. Is there a
specific way in which you should access  static final values in Struts.xml?

Cheers!
-- 
View this message in context: 
http://www.nabble.com/Accessing-constants-in-Struts.xml-tf4067389.html#a11557648
Sent from the Struts - User mailing list archive at Nabble.com.


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



Set a session value in the view

2007-07-03 Thread meeboo

Hey all

How can I achieve something like this:
%session.removeAttribute(successMessage);%

with the s:set tag? 

I tried s:set name=session.get('successMessage') value=null/ but it
didn't work.

Thanks!
-- 
View this message in context: 
http://www.nabble.com/Set-a-session-value-in-the-view-tf4018422.html#a11412642
Sent from the Struts - User mailing list archive at Nabble.com.


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



[S2] Design patterns

2007-06-11 Thread meeboo

Hey all

How do you build up your Struts 2 applications architecture wise? Say for
instance that you have a User model object. Do you create an action class
(e.g. UserAction.java) for all User actions, or do you separate them into
UpdateUser.java/CreateUser.java etc...? We thought Struts 2 was a big mess
at first since it allows you to construct your web-tier in virtually any way
you want. But after a couple of weeks we started using a pattern where
each JSP page has its own java action class and all action classes inherit
from a superclass which implements SessionAware, ValidationAware and so
forth. Do you think this is a good approach? It's worked great for us so
far. 

Cheers!
-- 
View this message in context: 
http://www.nabble.com/-S2--Design-patterns-tf3901386.html#a11059979
Sent from the Struts - User mailing list archive at Nabble.com.


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



[S2] s:textfield questions

2007-06-04 Thread meeboo

Hey all

Is there a way to set a default value for a s:textfield? I am trying
something like this: s:textfield name=someField value=s:property
value=someValue / but am receiving a TLD error. 

I also discovered that a s:form doesn't capture values from disabled input
fields, now I know that there's already been a bug reported on s:textfield
not being able to handle the 'disabled' attribute properly, but even if I
use a standard input disabled name=someValue/ the form won't parse the
value. Is this a bug or expected behaviour?

Thanks!
-- 
View this message in context: 
http://www.nabble.com/-S2--%3Cs%3Atextfield%3E-questions-tf3864087.html#a10946694
Sent from the Struts - User mailing list archive at Nabble.com.


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



URL question

2007-05-18 Thread meeboo

Hey all

Can I somehow hide the action name in a URL to make it more search engine
friendly? I am specifically talking about the index page (in for example
http://www.myapp.com/index.action ). 

Cheers
-- 
View this message in context: 
http://www.nabble.com/URL-question-tf3776809.html#a10679563
Sent from the Struts - User mailing list archive at Nabble.com.


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



Redirecting from mapping error exceptions

2007-05-16 Thread meeboo

Hey all

I have the following lines in Struts.xml

global-results
result name=error/index/result
/global-results
global-exception-mappings
exception-mapping result=error exception=java.lang.Throwable/
/global-exception-mappings

But it won't catch exceptions where the user has typed in an unmapped
address, all I get is
There is no Action mapped for namespace / and action name xxx (with status
report 500)

Can I somehow redirect all these exceptions to my index page?

Thanks!
-- 
View this message in context: 
http://www.nabble.com/Redirecting-from-mapping-error-exceptions-tf3763683.html#a10638948
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: [S2] UTF-8 woes

2007-05-08 Thread meeboo

We have got everything working now except for handling UTF8 strings when
doing file uploads from IE6 in Resin. It seems as if multipart/form-data
requests don't play well in this certain environment (we have tried it in
Tomcat and it works there). Has anyone had experience with file uploads from
IE6 to a application ran in Resin?

Thanks!


Christopher Schultz-2 wrote:
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 meeboo,
 
 meeboo wrote:
 But that other poster was using Struts 1! Also, I am already using 
 meta http-equiv=Content-Type content=text/html;
 charset=ISO-8859-1/meta 
 Has anyone had luck using for example å ä ö in S2 ?
 
 What is the character set actually being used by the request and the
 response? Just because you have ISO-8859-1 in your meta tag doesn't
 mean that the response is actually being sent and the request is
 actually being interpreted as ISO-8859-1.
 
 Here are some things to look at:
 
 1. What does request.getCharacterEncoding return?
 2. What does response.getCharacterEncoding return?
 3. What does System.getProperty(file.encoding) return?
 4. What does your HTTP or AJP listener have configured for
its default character set? (In Tomcat, the connectors
can use a default charset when the client does not provide
one in the request headers).
 5. You never mentioned whether you were using GET or POST. There
is a difference in how the data is decoded.
 
 - -chris
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.7 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
 iD8DBQFGOkSH9CaO5/Lv0PARAhC9AJ4rwoZJfegWReU+S5cenabnKOhDhQCgp2yA
 sKE5xIBugzsYFhEvKmjE+Qg=
 =jLc4
 -END PGP SIGNATURE-
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--UTF-8-woes-tf3688315.html#a10372401
Sent from the Struts - User mailing list archive at Nabble.com.


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



[S2] concurrency issues

2007-05-07 Thread meeboo

Hey all

We just launched a webapp using Hibernate/Spring/S2. The architecture is
pretty standard with a DAO, Service and a Web layer. Our problem is that we
are receiving massive traffic which pretty much kills the application after
just a couple of seconds. I am guessing this is since our S2 architecture is
a bit fragile (we're all S2 newbies). What we have done is that we have a
superclass called StrutsSupport which implements SessionAware,
ParameterAware and ValidationAware. We then have all of our Struts action
classes subclass StrutsSupport. StrutsSupport is also declared in Spring as 

bean id=strutsSupport class=com.myapp.web.struts.StrutsSupport
scope=prototype
property name=adminService ref=adminService /
property name=liveContentService ref=liveContentService /
property name=movieService ref=movieService /
property name=searchQueryService ref=searchQueryService /
property name=userService ref=userService /
/bean

As you can see it contains all our service class references. Our service
classes in turn look like this:

bean id=userService class=com.myapp.service.impl.UserServiceImpl
property name=newsletterSubscriberDao
ref=newsletterSubscriberDao /
property name=userDao ref=userDao /
property name=userMessageDao ref=userMessageDao /
property name=zipCodeDao ref=zipCodeDao /
/bean


Can it be the StrutsSupport superclass which is causing all the problems?
Should it be configured another way?

Thanks!!
-- 
View this message in context: 
http://www.nabble.com/-S2--concurrency-issues-tf3703183.html#a10355708
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: [S2] concurrency issues

2007-05-07 Thread meeboo

We have about 10 visits a day so it takes a small mistake to break the
app completely (it's happened before, maybe I should have a talk with our
server people). I found the mistake though, some methods were using
handrolled SQL and creating the session directly from a DaoSupport class
instead of the hibernateDaoTemplate. Thanks for the quick reply though Dave,
you're a stand up S2 guy :)


Dave Newton-4 wrote:
 
 --- meeboo [EMAIL PROTECTED] wrote:
 We just launched a webapp using Hibernate/Spring/S2.
 The architecture is pretty standard with a DAO, 
 Service and a Web layer. Our problem is that we
 are receiving massive traffic which pretty much
 kills the application after just a couple of
 seconds.
 
 A couple of *seconds*? I find it difficult to believe
 that you are receiving enough traffic in a couple of
 seconds to break your application.
 
 Define kills the application; what is actually
 happening?
 
 d.
 
 
 
  
 
 Expecting? Get great news right away with email Auto-Check. 
 Try the Yahoo! Mail Beta.
 http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--concurrency-issues-tf3703183.html#a10356581
Sent from the Struts - User mailing list archive at Nabble.com.


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



[S2]XML output problem

2007-05-05 Thread meeboo

Hey all

I am trying to output a RSS feed via a JSP page in S2. The problem is that I
keep on getting a blank row/new line before the actual XML data is written
to the page. The error message is XML Parsing Error: xml declaration not at
start of external entity because of this .

Here's the JSP code
%@ taglib prefix=s uri=/struts-tags %
%@ page contentType=text/xml; charset=UTF-8 %
%out.clear();% !--  Removes only one of the new lines --
s:property value=userMoviesFeed escape=false/

Where is this blank line coming from?

Thanks!
-- 
View this message in context: 
http://www.nabble.com/-S2-XML-output-problem-tf3697293.html#a10339053
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: [S2]XML output problem

2007-05-05 Thread meeboo

Damn it, I feel stupid now :p 

Thanks, and have a good weekend!


Dave Newton-4 wrote:
 
 --- meeboo [EMAIL PROTECTED] wrote:
 Where is this blank line coming from?
 
 The newlines in your JSP. Put it all on one line; just
 because there's a JSP directive there doesn't mean it
 will just ignore the rest of the line.
 
 Does your output create an XML declaration?
 
 d.
 
 
 
  
 
 Finding fabulous fares is fun.  
 Let Yahoo! FareChase search your favorite travel sites to find flight and
 hotel bargains.
 http://farechase.yahoo.com/promo-generic-14795097
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2-XML-output-problem-tf3697293.html#a10339579
Sent from the Struts - User mailing list archive at Nabble.com.


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



[S2] UTF-8 woes

2007-05-03 Thread meeboo

Hey all

I am trying to submit form data with UTF-8 characters but am having no luck.
The special characters are garbled when inserted in the database from a
s:form for example - this is regardless of what browser I am using. I am
using a page content type declaration for each page, but that doesn't help
at all. Do I need to declare it somewhere else in my Struts 2 application? I
remember that I in my old JSP/Servlet app had to convert certain characters
to special UTF-8 characters before saving Strings etc... but in S2 all I get
is question marks for special characters when I inspect incoming UTF-8
strings.

I am using this content type declaration. 
%@ page contentType=text/html; charset=ISO-8859-15 % 

I also used %@ page pageEncoding=UTF-8 % but to no avail.

Help!

Thanks!
-- 
View this message in context: 
http://www.nabble.com/-S2--UTF-8-woes-tf3688315.html#a10311092
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: [S2] UTF-8 woes

2007-05-03 Thread meeboo

But that other poster was using Struts 1! Also, I am already using 
meta http-equiv=Content-Type content=text/html;
charset=ISO-8859-1/meta 
Has anyone had luck using for example å ä ö in S2 ?

I am a very savvy Struts 2 mailing list user you know :)


meta http-equiv=Content-Type content=text/html;
charset=ISO-8859-1/meta 


Christopher Schultz-2 wrote:
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 meeboo,
 
 It's amazing to me that people not only don't read the archives, but
 they also don't read the messages posted on the same day or even in the
 /same hour/. :(
 
 - -chris
 
 meeboo wrote:
 Hey all
 
 I am trying to submit form data with UTF-8 characters but am having no
 luck.
 The special characters are garbled when inserted in the database from a
 s:form for example - this is regardless of what browser I am using. I
 am
 using a page content type declaration for each page, but that doesn't
 help
 at all. Do I need to declare it somewhere else in my Struts 2
 application? I
 remember that I in my old JSP/Servlet app had to convert certain
 characters
 to special UTF-8 characters before saving Strings etc... but in S2 all I
 get
 is question marks for special characters when I inspect incoming UTF-8
 strings.
 
 I am using this content type declaration. 
 %@ page contentType=text/html; charset=ISO-8859-15 % 
 
 I also used %@ page pageEncoding=UTF-8 % but to no avail.
 
 Help!
 
 Thanks!
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.7 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
 iD4DBQFGOjVa9CaO5/Lv0PARAqQeAJjR3Q4cAAOViTNxlRbVB9jH+/COAJ9bRghJ
 Gf3FpAnWCwY9yquHPPsKLw==
 =S2nd
 -END PGP SIGNATURE-
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--UTF-8-woes-tf3688315.html#a10312120
Sent from the Struts - User mailing list archive at Nabble.com.


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



Nested s:form

2007-04-28 Thread meeboo

Hey all

Is there a way to nest s:form elements in S2? I have a nested form which
won't reach the specified action, even though it is correctly mapped. If I
move it outside of the first form it automagically starts working. 

The action is mapped like:
action name=deleteMovie/*/ 
class=com.myapp.web.struts.action.user.UserProfile
method=deleteMovie
param name=movieId{1}/param
result name=success
type=redirect-actionuser/${normalizedUsername}/movies//result
result name=error/userProfile.jsp/result
/action

The odd thing is that the result success works fine (it even reads the
normalizedUsername), but the method deleteMovie is never reached when the
form is nested.

Any ideas?

Thanks!
-- 
View this message in context: 
http://www.nabble.com/Nested-%3Cs%3Aform%3E-tf3662755.html#a10234465
Sent from the Struts - User mailing list archive at Nabble.com.


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



s:textfield question

2007-04-27 Thread meeboo

Hey all

I am trying to populate the value of a s:textfield with some data from a
method via OGNL. I tried value=getTagsAsString(movie.id) which doesn't
work at all (the textfield is populated with getTagsAsString(movie.id)).
Then I tried the JSTL approach, by writing
value=%{#getTagsAsString(movie.id)} but that doesn't return a result at
all. It seems as if the method getTagsAsString isn't called - shouldn't  you
be able to do this via the value parameter of a s:textfield? I have pulled
it off before with s:property.

Thanks!
-- 
View this message in context: 
http://www.nabble.com/%3Cs%3Atextfield%3E-question-tf3657820.html#a10219702
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: s:textfield question

2007-04-27 Thread meeboo

I'm sure that it's on the stack. I am using another method call via OGNL
where I do s:property value=getMovieCategory(category)/ and that works
fine. But when I write s:textfield value=getMovieCategory(category)/ it
only prints out getMovieCategory(category). Is this expected behaviour or
a bug? 

Thanks!


Felipe Rodrigues wrote:
 
 Is the method you're calling binded in some action that result in this
 form?
 I mean, to call some method by OGNL this method should be on the stack.
 
 Make sure it is on the stack, if it is and keeps not working, post the
 code of your action and your form here.
 
 Regards,
 
 Felipe
 
 
 meeboo wrote:
 
 Hey all
 
 I am trying to populate the value of a s:textfield with some data from a
 method via OGNL. I tried value=getTagsAsString(movie.id) which doesn't
 work at all (the textfield is populated with
 getTagsAsString(movie.id)). Then I tried the JSTL approach, by writing
 value=%{#getTagsAsString(movie.id)} but that doesn't return a result at
 all. It seems as if the method getTagsAsString isn't called - shouldn't 
 you be able to do this via the value parameter of a s:textfield? I have
 pulled it off before with s:property.
 
 Thanks!
 
 
 

-- 
View this message in context: 
http://www.nabble.com/%3Cs%3Atextfield%3E-question-tf3657820.html#a10220153
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: s:textfield question

2007-04-27 Thread meeboo

value=%{getTagsAsString(id)} works like a charm. I'm still a bit confused
on whether to use the # prefix or not in certain places, but i'm glad it
works now :D

Thanks!


Felipe Rodrigues wrote:
 
 Well, when you're calling a method you should use %{} or #, otherwise it
 would print as a literal.
 I'm not sure about what of % or # will work.
 
 
 Dave Newton-4 wrote:
 
 --- meeboo [EMAIL PROTECTED] wrote:
 But when I write s:textfield
 value=getMovieCategory(category)/ it
 only prints out getMovieCategory(category). 
 
 Does %{getMovieCategory(category)} work?
 
 d.
 
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around 
 http://mail.yahoo.com 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/%3Cs%3Atextfield%3E-question-tf3657820.html#a10222430
Sent from the Struts - User mailing list archive at Nabble.com.


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



Another file upload question

2007-04-24 Thread meeboo

Hey all

I have an action class which handles file uploads via a setter method:

private File uploadedMovie = null;
public void setUploadedMovie(File uploadedMovie) {this.uploadedMovie =
uploadedMovie;}

The problem is that I can't set the name of the uploaded file before it is
saved to the drive. I can specify the path but the file name is some random
generated key by Tomcat. Can I somehow intercept the upload before it has
been saved to the  drive and change the name? If not, are there other
alternatives?

Thanks!
-- 
View this message in context: 
http://www.nabble.com/Another-file-upload-question-tf3638618.html#a10160759
Sent from the Struts - User mailing list archive at Nabble.com.


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



Iterating through a map

2007-04-23 Thread meeboo

Hey all

How do I iterate through a map? My current method returns a
LinkedHashMapString, Movie - the map is populated and accessed by the view
as my debugger shows, but it is never iterated through. Here's the JSP
fragment

s:iterator value=aMovieFromEachCategory
pShould iterate 12 times/p  

/s:iterator

Thanks!
-- 
View this message in context: 
http://www.nabble.com/Iterating-through-a-map-tf3633177.html#a10145180
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Iterating through a map

2007-04-23 Thread meeboo

Just read from the WW in action book - 

One of the nicest features about the iterator tag is that it can iterate
over just about any data type that has a concept of iteration. When
iterating over a Map, it iterates over the Set returned by Map.entrySet(),
which is a set of Map.Entry
objects, which in turn has the methods getKey() and getValue() to retrieve
the associated key/value pairs.

The key to retrieving the values is to use s:property value=key/ and
s:property value=value/


Felipe Rodrigues wrote:
 
 I'm not so sure if you can iterate over a Map. Even in Plain Old Java Code
 you can't do that.
 A good solution is create a keySet or a list from Map's keys and iterate
 over that, using each object to get the Map values. 
 
 Good look,
 
 
 Felipe
 
 
 
 meeboo wrote:
 
 Hey all
 
 How do I iterate through a map? My current method returns a
 LinkedHashMapString, Movie - the map is populated and accessed by the
 view as my debugger shows, but it is never iterated through. Here's the
 JSP fragment
 
 s:iterator value=aMovieFromEachCategory
  pShould iterate 12 times/p  
 
 /s:iterator
 
 Thanks!
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Iterating-through-a-map-tf3633177.html#a10146427
Sent from the Struts - User mailing list archive at Nabble.com.


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



Nesting a s:property in a s:url/

2007-04-18 Thread meeboo

Hey all

I am trying to include a session property in a s:url component, but get
the following error:

Unterminated lt;s:url tag

s:url action=user/s:property value=#session.user.username ///

Are there other ways of including session values without nesting S2
components?
-- 
View this message in context: 
http://www.nabble.com/Nesting-a-%3Cs%3Aproperty%3E-in-a-%3Cs%3Aurl-%3E-tf3600500.html#a10056979
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Nesting a s:property in a s:url/

2007-04-18 Thread meeboo

Yeah it works, I tried

s:url action= My profile br /


Dave Newton-4 wrote:
 
 --- meeboo [EMAIL PROTECTED] wrote:
 s:url action=user/s:property
 value=#session.user.username ///
 
 Are there other ways of including session values
 without nesting S2 components?
 
 Does using OGNL EL in the action attribute not work?
 (It's never been entirely clear to me where I'm
 allowed to use it.)
 
 d.
 
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around 
 http://mail.yahoo.com 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Nesting-a-%3Cs%3Aproperty%3E-in-a-%3Cs%3Aurl-%3E-tf3600500.html#a10057313
Sent from the Struts - User mailing list archive at Nabble.com.


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



Problem with form action mapping

2007-04-18 Thread meeboo

Hey all

I've been trying to solve this problem for a couple of hours but to no
prevail...

struts.xml
action name=upload/
 result/uploadMovie.jsp/result
/action
action name=uploadMovie
class=com.myapp.web.struts.action.UploadMovie
method=uploadFile
 result name=success/index.jsp/result
  result name=input/uploadMovie.jsp/result
/action

uploadMovie.jsp
s:form action=/uploadMovie enctype=multipart/form-data method=post
s:textfield name=movieTitle/
s:file name=uploadedMovie/
s:submit value=Upload/
/s:form

UploadMovie.java
public String uploadFile()
{
if(movieTitle != null  uploadedMovie !=null)
return SUCCESS;
else
return INPUT;
}

What I'm doing is that I'm accessing localhost:8080/someApp/upload/ - so far
so good, the form shows up and you can pick the file to upload. But when I
submit the form it never reaches the uploadFile() method! The odd thing is
that when I view the HTML source for the form it says 
form id=uploadMovie onsubmit=return true; action=/myApp/uploadMovie
method=post enctype=multipart/form-data - which is correct. If I on
the other hand access the url http://localhost:8080/myApp/uploadMovie
directly from the browser (without using the form) the uploadFile() method
will be reached. I find this pretty confusing and suspect that there's a
mapping error somewhere in the code, but I haven't been able to identify it
even after a couple of hours. Any takers?

Thanks!
-- 
View this message in context: 
http://www.nabble.com/Problem-with-form-action-mapping-tf3601247.html#a10059516
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Problem with form action mapping

2007-04-18 Thread meeboo

Quick note, it seems as if I am reaching the uploadFile method when not
specifying a file to upload. The movieTitle is then read in the action
class. But if I also choose to upload a file alongside with it the method
will not be reached. I'm stumped! :(


meeboo wrote:
 
 Hey all
 
 I've been trying to solve this problem for a couple of hours but to no
 prevail...
 
 struts.xml
 action name=upload/
  result/uploadMovie.jsp/result
 /action
 action name=uploadMovie
   class=com.myapp.web.struts.action.UploadMovie
   method=uploadFile
  result name=success/index.jsp/result
   result name=input/uploadMovie.jsp/result
 /action
 
 uploadMovie.jsp
 s:form action=/uploadMovie enctype=multipart/form-data method=post
 s:textfield name=movieTitle/
 s:file name=uploadedMovie/
 s:submit value=Upload/
 /s:form
 
 UploadMovie.java
 public String uploadFile()
 {
   if(movieTitle != null  uploadedMovie !=null)
   return SUCCESS;
   else
   return INPUT;
 }
 
 What I'm doing is that I'm accessing localhost:8080/someApp/upload/ - so
 far so good, the form shows up and you can pick the file to upload. But
 when I submit the form it never reaches the uploadFile() method! The odd
 thing is that when I view the HTML source for the form it says 
 form id=uploadMovie onsubmit=return true;
 action=/myApp/uploadMovie method=post enctype=multipart/form-data
 - which is correct. If I on the other hand access the url
 http://localhost:8080/myApp/uploadMovie directly from the browser (without
 using the form) the uploadFile() method will be reached. I find this
 pretty confusing and suspect that there's a mapping error somewhere in the
 code, but I haven't been able to identify it even after a couple of hours.
 Any takers?
 
 Thanks!
 

-- 
View this message in context: 
http://www.nabble.com/Problem-with-form-action-mapping-tf3601247.html#a10060312
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Problem with form action mapping

2007-04-18 Thread meeboo

Oddly enough I checked out the code to continue my work from home and it
suddenly started working. I'm gonna take a look at this inconsistency
tomorrow, might be something else than S2 which is causing it. And yes, I'm
using the cleanup filter. Thanks anyway!


Dave Newton-4 wrote:
 
 It may not solve your problem, but are you using the
 action context cleanup filter?
 
 d.
 
 --- meeboo [EMAIL PROTECTED] wrote:
 
 
 Quick note, it seems as if I am reaching the
 uploadFile method when not
 specifying a file to upload. The movieTitle is then
 read in the action
 class. But if I also choose to upload a file
 alongside with it the method
 will not be reached. I'm stumped! :(
 
 
 meeboo wrote:
  
  Hey all
  
  I've been trying to solve this problem for a
 couple of hours but to no
  prevail...
  
  struts.xml
  action name=upload/
   result/uploadMovie.jsp/result
  /action
  action name=uploadMovie
 
 class=com.myapp.web.struts.action.UploadMovie
 method=uploadFile
   result name=success/index.jsp/result
result
 name=input/uploadMovie.jsp/result
  /action
  
  uploadMovie.jsp
  s:form action=/uploadMovie
 enctype=multipart/form-data method=post
  s:textfield name=movieTitle/
  s:file name=uploadedMovie/
  s:submit value=Upload/
  /s:form
  
  UploadMovie.java
  public String uploadFile()
  {
 if(movieTitle != null  uploadedMovie !=null)
 return SUCCESS;
 else
 return INPUT;
  }
  
  What I'm doing is that I'm accessing
 localhost:8080/someApp/upload/ - so
  far so good, the form shows up and you can pick
 the file to upload. But
  when I submit the form it never reaches the
 uploadFile() method! The odd
  thing is that when I view the HTML source for the
 form it says 
  form id=uploadMovie onsubmit=return true;
  action=/myApp/uploadMovie method=post
 enctype=multipart/form-data
  - which is correct. If I on the other hand access
 the url
  http://localhost:8080/myApp/uploadMovie directly
 from the browser (without
  using the form) the uploadFile() method will be
 reached. I find this
  pretty confusing and suspect that there's a
 mapping error somewhere in the
  code, but I haven't been able to identify it even
 after a couple of hours.
  Any takers?
  
  Thanks!
  
 
 -- 
 View this message in context:

 http://www.nabble.com/Problem-with-form-action-mapping-tf3601247.html#a10060312
 Sent from the Struts - User mailing list archive at
 Nabble.com.
 
 

 -
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 
 
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around 
 http://mail.yahoo.com 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Problem-with-form-action-mapping-tf3601247.html#a10064144
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: struts.action.extension question

2007-04-11 Thread meeboo

No takers on this?


meeboo wrote:
 
 Hey all
 
 I have a mapping pattern which looks like this
 
 action name=movie/* class=com.bubbleclip.web.struts.action.PlayMovie
 param name=movieTitle{1}/param
 result/movie.jsp/result
 /action
 
 The wildcard is for backwards compability since our original JSP/Servlet
 web-layer mapped movie titles like 
 http:localhost:8080/movie/movieTitle
 
 This works fine if I set struts.action.extension to , this way I
 preserve compatibility since the movie title is the actual action name.
 The problem is that S2 will also interpret everything else as being
 actions - even CSS names making the pages not render correctly. Is there a
 way around this?
 

-- 
View this message in context: 
http://www.nabble.com/struts.action.extension-question-tf3548145.html#a9934814
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: struts.action.extension question

2007-04-11 Thread meeboo

The problem is that I have a lot of URL:s which look like /user/username,
movie/movieTitle or account/create - and I don't want to forward or redirect
for each URL since this will slow down my application. Is there a way to
exclude .css extensions maybe?


joey-30 wrote:
 
 keep struts.action.extension default.and create a filter to make sure
 it's before the struts filter.like this:
 filter-mapping
 filter-nameyourfilter/filter-name
 url-patternmovie/*/url-pattern
 /filter-mapping
 filter-mapping
 filter-namestruts2/filter-name
 url-pattern/*/url-pattern
 /filter-mapping
 u can foward or redirect to the url movie.action?movieTitle=* or something
 else in your
 filter.
 
 regards
 joey
 On 4/11/07, meeboo [EMAIL PROTECTED] wrote:


 No takers on this?


 meeboo wrote:
 
  Hey all
 
  I have a mapping pattern which looks like this
 
  action name=movie/*
 class=com.bubbleclip.web.struts.action.PlayMovie
 
  param name=movieTitle{1}/param
  result/movie.jsp/result
  /action
 
  The wildcard is for backwards compability since our original
 JSP/Servlet
  web-layer mapped movie titles like
  http:localhost:8080/movie/movieTitle
 
  This works fine if I set struts.action.extension to , this way I
  preserve compatibility since the movie title is the actual action name.
  The problem is that S2 will also interpret everything else as being
  actions - even CSS names making the pages not render correctly. Is
 there
 a
  way around this?
 

 --
 View this message in context:
 http://www.nabble.com/struts.action.extension-question-tf3548145.html#a9934814
 Sent from the Struts - User mailing list archive at Nabble.com.


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


 
 

-- 
View this message in context: 
http://www.nabble.com/struts.action.extension-question-tf3548145.html#a9936131
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: struts.action.extension question

2007-04-11 Thread meeboo

Unfortunately I'm running Tomcat. I did come up with a pretty clean solution
though, what I do is that I link to the CSS /JS/Image files via an absolute
URL, so instead of public/css/design.css I use
http://mydomain.com/public/css/design.css; - good enough for me at the
moment.


cilquirm wrote:
 
 I don't believe this can be cleanly handled with just the web 2.4 spec and
 struts2.
 
 Some container, like Resin, allow for url-patterns to be regexes, which
 would help in this scenario.
 
 
 
 meeboo wrote:
 
 The problem is that I have a lot of URL:s which look like /user/username,
 movie/movieTitle or account/create - and I don't want to forward or
 redirect for each URL since this will slow down my application. Is there
 a way to exclude .css extensions maybe?
 
 
 joey-30 wrote:
 
 keep struts.action.extension default.and create a filter to make sure
 it's before the struts filter.like this:
 filter-mapping
 filter-nameyourfilter/filter-name
 url-patternmovie/*/url-pattern
 /filter-mapping
 filter-mapping
 filter-namestruts2/filter-name
 url-pattern/*/url-pattern
 /filter-mapping
 u can foward or redirect to the url movie.action?movieTitle=* or
 something
 else in your
 filter.
 
 regards
 joey
 On 4/11/07, meeboo [EMAIL PROTECTED] wrote:


 No takers on this?


 meeboo wrote:
 
  Hey all
 
  I have a mapping pattern which looks like this
 
  action name=movie/*
 class=com.bubbleclip.web.struts.action.PlayMovie
 
  param name=movieTitle{1}/param
  result/movie.jsp/result
  /action
 
  The wildcard is for backwards compability since our original
 JSP/Servlet
  web-layer mapped movie titles like
  http:localhost:8080/movie/movieTitle
 
  This works fine if I set struts.action.extension to , this way I
  preserve compatibility since the movie title is the actual action
 name.
  The problem is that S2 will also interpret everything else as being
  actions - even CSS names making the pages not render correctly. Is
 there
 a
  way around this?
 

 --
 View this message in context:
 http://www.nabble.com/struts.action.extension-question-tf3548145.html#a9934814
 Sent from the Struts - User mailing list archive at Nabble.com.


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


 
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/struts.action.extension-question-tf3548145.html#a9946297
Sent from the Struts - User mailing list archive at Nabble.com.


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



struts.action.extension question

2007-04-09 Thread meeboo


-- 
View this message in context: 
http://www.nabble.com/struts.action.extension-question-tf3548145.html#a9905001
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: resume after login feature

2007-04-06 Thread meeboo

One last question regarding this. As I beforehand don't know where to
redirect the user after the login action I will have to implement the
ServletResponseAware interface and then use the HttpServletResponse for
this. This seems like an ugly way to redirect the user, are there other ways
maybe?


Dave Newton-4 wrote:
 
 --- meeboo [EMAIL PROTECTED] wrote:
 Yeah Dave, the problem is passing the data. I have
 my Login.java action class which implements 
 ServletRequestAware but it'll of course only
 retrieve
 localhost:8080/login.action since that's the request
 URI. I need to somehow tell it which location the 
 user tried to login from so that it can redirect
 back to that specific page. 
 
 Passing information to an Action is trivial; implement
 a known or new interface and set the data inside the
 interceptor. 
 
 You don't care about the *action's* view of
 request-land, you care about the *interceptor's*
 request; that's where the original (request) is, no?
 
 d.
 
 
 
  
 
 Don't pick lemons.
 See all the new 2007 cars at Yahoo! Autos.
 http://autos.yahoo.com/new_cars.html 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/resume-after-login-feature-tf3506442.html#a9870255
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: resume after login feature

2007-04-05 Thread meeboo

I'm kind of stumped on this problem too, how can I send the original request
uri to the login action so that it knows what page to redirect to? 



Jae K wrote:
 
 Hello all, this is a struts2 question.
 
 I'm trying to implement a feature where a custom AuthenticationInterceptor
 would redirect the useragent to a login page, and then after the user logs
 in, he is redirected to the original request page.
 
 First, I have to send the original request path has a parameter to the
 login
 page or as a hidden field. To do this I plan to do one of the following.
 1) use Redirect-Action with an OGNL param that looks like ${request.path}.
 I'm not familiar with OGNL so I'm not sure this will work
 2) create a custom Redirect class that will use the HttpServletRequest and
 HttpServletResponse objects to send the original request path in the
 redirect URL.
 
 Then as a result of the Login action I will need a way to redirect the
 user
 again, this time to the original request path. Again, I plan to use
 Redirect-Action with an OGNL param (maybe like
 ${request.param['origpath']}),
 or a custom Redirect class.
 
 Please let me know the path to take, or whether there is a better way to
 do
 this. Thanks in advance.
 
  - Jae
 
 

-- 
View this message in context: 
http://www.nabble.com/resume-after-login-feature-tf3506442.html#a9856930
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: resume after login feature

2007-04-05 Thread meeboo

Yeah Dave, the problem is passing the data. I have my Login.java action class
which implements ServletRequestAware but it'll of course only retrieve
localhost:8080/login.action since that's the request URI. I need to somehow
tell it which location the user tried to login from so that it can redirect
back to that specific page. 



Dave Newton-4 wrote:
 
 --- meeboo [EMAIL PROTECTED] wrote:
 I'm kind of stumped on this problem too, how can I
 send the original request uri to the login action so
 
 that it knows what page to redirect to? 
 
 Which is the problem; getting the original request, or
 sending data to the action?
 
 Sending data to the action is easy; you can use an
 existing interface (like parameter aware, etc.) to
 pass a key/value, or you can create a new known
 interface (like setOriginalRequest or whatever) and
 use that.
 
 The OP had a few ideas for getting the original
 request, so I assume your question is passing the
 data?
 
 d.
 
 Jae K wrote:
 I'm trying to implement a feature where a custom
 AuthenticationInterceptor would redirect the 
 useragent to a login page, and then after the user 
 logs in, he is redirected to the original request 
 page.
 
 First, I have to send the original request path
 has a parameter to the login page or as a hidden 
 field. To do this I plan to do one of the
 following.
 1) use Redirect-Action with an OGNL param that
 looks like ${request.path}. I'm not familiar with 
 OGNL so I'm not sure this will work
 2) create a custom Redirect class that will use
 the HttpServletRequest and HttpServletResponse 
 objects to send the original request path in the
 redirect URL.
 
 
 
  
 
 Get your own web address.  
 Have a HUGE year through Yahoo! Small Business.
 http://smallbusiness.yahoo.com/domains/?p=BESTDEAL
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/resume-after-login-feature-tf3506442.html#a9857239
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: resume after login feature

2007-04-05 Thread meeboo

Gotcha Dave... now all I need is clean URL:s before I can actually consider
using this damned framework :)



Dave Newton-4 wrote:
 
 --- meeboo [EMAIL PROTECTED] wrote:
 Yeah Dave, the problem is passing the data. I have
 my Login.java action class which implements 
 ServletRequestAware but it'll of course only
 retrieve
 localhost:8080/login.action since that's the request
 URI. I need to somehow tell it which location the 
 user tried to login from so that it can redirect
 back to that specific page. 
 
 Passing information to an Action is trivial; implement
 a known or new interface and set the data inside the
 interceptor. 
 
 You don't care about the *action's* view of
 request-land, you care about the *interceptor's*
 request; that's where the original (request) is, no?
 
 d.
 
 
 
  
 
 Don't pick lemons.
 See all the new 2007 cars at Yahoo! Autos.
 http://autos.yahoo.com/new_cars.html 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/resume-after-login-feature-tf3506442.html#a9857985
Sent from the Struts - User mailing list archive at Nabble.com.


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



RE: Common header and footer html

2007-03-30 Thread meeboo

Is there a good way of achieving this in Struts 2 without using Tiles? I'm
new to Struts and coming from a Tapestry background my first hunch was to
create classes for a header and a footer element, but is this even a viable
option in an action based framework? If not, what's the best practice when
you're faced with implementing such a thing?

Cheers


Raghupathy, Gurumoorthy wrote:
 
 http://struts.apache.org/1.x/struts-tiles/ is your answer 
 
 Regards
 Guru
  
 
 -Original Message-
 From: Ståle Undheim [mailto:[EMAIL PROTECTED] 
 Sent: 30 March 2007 13:55
 To: user@struts.apache.org
 Subject: Common header and footer html
 
 Currently, all my jsp pages are structured like this:
 * identical html header and body tag ...
 * page specific content
 * identical trail of /body and /html
 
 Instead of copying this for every file, I would like to have 1 common
 outer wrapper file, that includes a jsp based on the action or
 something.
 
 I have been looking at the tiles plugin, but I couldn't make out
 enough from the documentation to see how I could use it.
 
 My ideal solution would be something like having a layout.jsp that
 looks like this:
 DOCTYPE
 html
 head/head
 body
 % include jsp based on ActionName or an annotation, or that I can set
 with an interceptor of sorts. %
 /body
 /html
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Common-header-and-footer-html-tf3492025.html#a9753895
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: [S2] There is no Action mapped for action name HelloWorld. - [unknown location]

2007-03-09 Thread meeboo

There is nothing in the logs which hints a startup or request error, but as
soon as I click on HelloWorld under the Actions in default tab in
config-browser I get this stacktrace:

Expression extension is undefined on line 15, column 89 in
config-browser/showConfig.ftl.
The problematic instruction:
--
== ${extension} [on line 15, column 87 in config-browser/showConfig.ftl]
--

Java backtrace for programmers:
--
freemarker.core.InvalidReferenceException: Expression extension is undefined
on line 15, column 89 in config-browser/showConfig.ftl.


Here's struts.xml:

struts
package name=/ extends=struts-default
action name=HelloWorld
class=com.bubbleclip.web.struts.HelloWorld
result/HelloWorld.jsp/result
/action
!-- Add your actions here --
/package
/struts


I followed the HelloWorld example and have all the libraries present, so I
think it might boil down to my Java environment. I'm running Eclipse WTP
with Tomcat 5.5 as my local server. The odd thing is that I am getting this
error even when I try to click on the config-browser actions. 




Dave Newton-4 wrote:
 
 Re-asking if there's anything in the logs that seems
 relevent both on startup and on the request? Also, if
 you're getting the freemarker error, look *before* the
 freemarker error in the log to see what the actual
 problem is (and turn devMode on).
 
 d.
 
 --- meeboo [EMAIL PROTECTED] wrote:
 
 
 I tried using the maven archetype but still get the
 same error (even with the
 Config-browser plugin). Could someone maybe guide me
 through the
 configuration process for a simple Struts 2 hello
 world application? I'm
 having trouble grasping what the bare minimum amount
 of files is to set up a
 Struts 2 app (without Spring).
 
 
 Ian Roughley wrote:
  
  I recently fixed the starter maven archetype, it
 might be a better 
  starting point.
  
  /Ian
  
  Musachy Barroso wrote:
  well, something is quite broken :), do you get
 any error log when you 
  start
  the app?
 
  musachy
 
  On 3/7/07, meeboo [EMAIL PROTECTED] wrote:
 
 
  This might be well out of your reach, but I did
 as you said and 
  downloaded
  the config browser plugin. Under namespaces I
 can see
 
  default
  /config-browser
  /com/bubbleclip/web/example
 
  When I click one of the actions an exception
 occurs and I am told that
 
  FreeMarker template error!
 
  Expression extension is undefined on line 15,
 column 89 in
  config-browser/showConfig.ftl.
  The problematic instruction:
  --
  ==gt; ${extension} [on line 15, column 87 in
  config-browser/showConfig.ftl]
 
  Is there a configuration error on my part
 perhaps? Even the 
  config-browser
  actions show this exception.
 
 
 
  Musachy Barroso wrote:
  
   yes, that should be it. If you are
 learning||having problems, you can
  use
   the Struts Config browser plugin:
  
  

 http://struts.apache.org/2.x/docs/config-browser-plugin.html
  
   to see the mapping of your actions and play
 around with them.
  
   musachy
  
   On 3/7/07, meeboo [EMAIL PROTECTED] wrote:
  
  
   Thanks for your quick reply, but I get a
  
   HTTP Status 404 -
 /com/bubbleclip/web/example/HelloWorld.action
  
   When you typed and access the action: you
 meant by typing
   
 

 localhost:8080/application/com/bubbleclip/web/example/HelloWorld.action
   as
   the browser URL right?
  
  
  
   Musachy Barroso wrote:
   
Try setting
 namespace=/com/bubbleclip/web/example, in the 
  package,
   and
access the action:
   
   
 {...}/com/bubbleclip/web/example/HelloWorld.action
   
musachy
   
On 3/7/07, meeboo [EMAIL PROTECTED]
 wrote:
   
   
Hey all
   
I recently decided to evaluate Struts2 for
 a big project, but am
   having
difficulties mapping actions. I get the
 There is no Action
  mapped...
error
when I try running the blank struts2
 application.
   
Here's my example.xml
   
package name=example
 namespace=com/bubbleclip/web/example
extends=struts-default
   
action name=HelloWorld
   
 class=com.bubbleclip.web.example.HelloWorld
   
 result/web/example/HelloWorld.jsp/result
/action
   
action name=Login_*
 method={1}
class=com.bubbleclip.web.example.Login
result
 name=input/example/Login.jsp/result
result
 type=redirect-actionMenu/result
/action
   
action name=* class=
   com.bubbleclip.web.example.ExampleSupport

   
 result/example/{1}.jsp/result
/action
   
!-- Add actions here --
/package
   
My directory tree looks like the
 following:
   

 application/src/com/bubbleclip/web/example/ExampleSupport.java
   

 application/src/com/bubbleclip/web/example/HelloWorld.java
   

 application/src/com/bubbleclip/web/example/Login.java
   

 application/src/com/bubbleclip/web/example/Login-validation.xml
   

 application/src/com/bubbleclip/web/example

Re: [S2] There is no Action mapped for action name HelloWorld. - [unknown location]

2007-03-08 Thread meeboo

I tried using the maven archetype but still get the same error (even with the
Config-browser plugin). Could someone maybe guide me through the
configuration process for a simple Struts 2 hello world application? I'm
having trouble grasping what the bare minimum amount of files is to set up a
Struts 2 app (without Spring).


Ian Roughley wrote:
 
 I recently fixed the starter maven archetype, it might be a better 
 starting point.
 
 /Ian
 
 Musachy Barroso wrote:
 well, something is quite broken :), do you get any error log when you 
 start
 the app?

 musachy

 On 3/7/07, meeboo [EMAIL PROTECTED] wrote:


 This might be well out of your reach, but I did as you said and 
 downloaded
 the config browser plugin. Under namespaces I can see

 default
 /config-browser
 /com/bubbleclip/web/example

 When I click one of the actions an exception occurs and I am told that

 FreeMarker template error!

 Expression extension is undefined on line 15, column 89 in
 config-browser/showConfig.ftl.
 The problematic instruction:
 --
 ==gt; ${extension} [on line 15, column 87 in
 config-browser/showConfig.ftl]

 Is there a configuration error on my part perhaps? Even the 
 config-browser
 actions show this exception.



 Musachy Barroso wrote:
 
  yes, that should be it. If you are learning||having problems, you can
 use
  the Struts Config browser plugin:
 
  http://struts.apache.org/2.x/docs/config-browser-plugin.html
 
  to see the mapping of your actions and play around with them.
 
  musachy
 
  On 3/7/07, meeboo [EMAIL PROTECTED] wrote:
 
 
  Thanks for your quick reply, but I get a
 
  HTTP Status 404 - /com/bubbleclip/web/example/HelloWorld.action
 
  When you typed and access the action: you meant by typing
  
 localhost:8080/application/com/bubbleclip/web/example/HelloWorld.action
  as
  the browser URL right?
 
 
 
  Musachy Barroso wrote:
  
   Try setting namespace=/com/bubbleclip/web/example, in the 
 package,
  and
   access the action:
  
   {...}/com/bubbleclip/web/example/HelloWorld.action
  
   musachy
  
   On 3/7/07, meeboo [EMAIL PROTECTED] wrote:
  
  
   Hey all
  
   I recently decided to evaluate Struts2 for a big project, but am
  having
   difficulties mapping actions. I get the There is no Action
 mapped...
   error
   when I try running the blank struts2 application.
  
   Here's my example.xml
  
   package name=example namespace=com/bubbleclip/web/example
   extends=struts-default
  
   action name=HelloWorld
   class=com.bubbleclip.web.example.HelloWorld
   result/web/example/HelloWorld.jsp/result
   /action
  
   action name=Login_* method={1}
   class=com.bubbleclip.web.example.Login
   result name=input/example/Login.jsp/result
   result type=redirect-actionMenu/result
   /action
  
   action name=* class=
  com.bubbleclip.web.example.ExampleSupport
   
   result/example/{1}.jsp/result
   /action
  
   !-- Add actions here --
   /package
  
   My directory tree looks like the following:
   application/src/com/bubbleclip/web/example/ExampleSupport.java
   application/src/com/bubbleclip/web/example/HelloWorld.java
   application/src/com/bubbleclip/web/example/Login.java
   application/src/com/bubbleclip/web/example/Login-validation.xml
   application/src/com/bubbleclip/web/example/Package.properties
   application/src/example.xml
   application/src/struts.xml
   application/web/index.html
   application/web/example/HelloWorld.jsp
   application/web/WEB-INF/web.xml
   --
   View this message in context:
  
 
 http://www.nabble.com/There-is-no-Action-mapped-for-action-name-HelloWorld.unknown-location--tf3362312.html#a9353654
  

   Sent from the Struts - User mailing list archive at Nabble.com.
  
  
  
 -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
  
   --
   Hey you! Would you help me to carry the stone? Pink Floyd
  
  
 
  --
  View this message in context:
 
 http://www.nabble.com/There-is-no-Action-mapped-for-action-name-HelloWorld.unknown-location--tf3362312.html#a9354348
  

  Sent from the Struts - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
  --
  Hey you! Would you help me to carry the stone? Pink Floyd
 
 

 -- 
 View this message in context:
 http://www.nabble.com/There-is-no-Action-mapped-for-action-name-HelloWorld.unknown-location--tf3362312.html#a9355632
  

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


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

There is no Action mapped for action name HelloWorld. - [unknown location]

2007-03-07 Thread meeboo

Hey all

I recently decided to evaluate Struts2 for a big project, but am having
difficulties mapping actions. I get the There is no Action mapped... error
when I try running the blank struts2 application.

Here's my example.xml

package name=example namespace=com/bubbleclip/web/example
extends=struts-default

action name=HelloWorld
class=com.bubbleclip.web.example.HelloWorld
result/web/example/HelloWorld.jsp/result
/action

action name=Login_* method={1}
class=com.bubbleclip.web.example.Login
result name=input/example/Login.jsp/result
result type=redirect-actionMenu/result
/action

action name=* class=com.bubbleclip.web.example.ExampleSupport
result/example/{1}.jsp/result
/action

!-- Add actions here --
/package

My directory tree looks like the following:
application/src/com/bubbleclip/web/example/ExampleSupport.java
application/src/com/bubbleclip/web/example/HelloWorld.java
application/src/com/bubbleclip/web/example/Login.java
application/src/com/bubbleclip/web/example/Login-validation.xml
application/src/com/bubbleclip/web/example/Package.properties
application/src/example.xml
application/src/struts.xml
application/web/index.html
application/web/example/HelloWorld.jsp
application/web/WEB-INF/web.xml
-- 
View this message in context: 
http://www.nabble.com/There-is-no-Action-mapped-for-action-name-HelloWorld.unknown-location--tf3362312.html#a9353654
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: [S2] There is no Action mapped for action name HelloWorld. - [unknown location]

2007-03-07 Thread meeboo

Thanks for your quick reply, but I get a 

HTTP Status 404 - /com/bubbleclip/web/example/HelloWorld.action

When you typed and access the action: you meant by typing
localhost:8080/application/com/bubbleclip/web/example/HelloWorld.action as
the browser URL right?



Musachy Barroso wrote:
 
 Try setting namespace=/com/bubbleclip/web/example, in the package, and
 access the action:
 
 {...}/com/bubbleclip/web/example/HelloWorld.action
 
 musachy
 
 On 3/7/07, meeboo [EMAIL PROTECTED] wrote:


 Hey all

 I recently decided to evaluate Struts2 for a big project, but am having
 difficulties mapping actions. I get the There is no Action mapped...
 error
 when I try running the blank struts2 application.

 Here's my example.xml

 package name=example namespace=com/bubbleclip/web/example
 extends=struts-default

 action name=HelloWorld
 class=com.bubbleclip.web.example.HelloWorld
 result/web/example/HelloWorld.jsp/result
 /action

 action name=Login_* method={1}
 class=com.bubbleclip.web.example.Login
 result name=input/example/Login.jsp/result
 result type=redirect-actionMenu/result
 /action

 action name=* class=com.bubbleclip.web.example.ExampleSupport
 
 result/example/{1}.jsp/result
 /action

 !-- Add actions here --
 /package

 My directory tree looks like the following:
 application/src/com/bubbleclip/web/example/ExampleSupport.java
 application/src/com/bubbleclip/web/example/HelloWorld.java
 application/src/com/bubbleclip/web/example/Login.java
 application/src/com/bubbleclip/web/example/Login-validation.xml
 application/src/com/bubbleclip/web/example/Package.properties
 application/src/example.xml
 application/src/struts.xml
 application/web/index.html
 application/web/example/HelloWorld.jsp
 application/web/WEB-INF/web.xml
 --
 View this message in context:
 http://www.nabble.com/There-is-no-Action-mapped-for-action-name-HelloWorld.unknown-location--tf3362312.html#a9353654
 Sent from the Struts - User mailing list archive at Nabble.com.


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


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

-- 
View this message in context: 
http://www.nabble.com/There-is-no-Action-mapped-for-action-name-HelloWorld.unknown-location--tf3362312.html#a9354348
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: [S2] There is no Action mapped for action name HelloWorld. - [unknown location]

2007-03-07 Thread meeboo

This might be well out of your reach, but I did as you said and downloaded
the config browser plugin. Under namespaces I can see

default
/config-browser
/com/bubbleclip/web/example

When I click one of the actions an exception occurs and I am told that

FreeMarker template error!

Expression extension is undefined on line 15, column 89 in
config-browser/showConfig.ftl.
The problematic instruction:
--
==gt; ${extension} [on line 15, column 87 in
config-browser/showConfig.ftl]

Is there a configuration error on my part perhaps? Even the config-browser
actions show this exception. 



Musachy Barroso wrote:
 
 yes, that should be it. If you are learning||having problems, you can use
 the Struts Config browser plugin:
 
 http://struts.apache.org/2.x/docs/config-browser-plugin.html
 
 to see the mapping of your actions and play around with them.
 
 musachy
 
 On 3/7/07, meeboo [EMAIL PROTECTED] wrote:


 Thanks for your quick reply, but I get a

 HTTP Status 404 - /com/bubbleclip/web/example/HelloWorld.action

 When you typed and access the action: you meant by typing
 localhost:8080/application/com/bubbleclip/web/example/HelloWorld.action
 as
 the browser URL right?



 Musachy Barroso wrote:
 
  Try setting namespace=/com/bubbleclip/web/example, in the package,
 and
  access the action:
 
  {...}/com/bubbleclip/web/example/HelloWorld.action
 
  musachy
 
  On 3/7/07, meeboo [EMAIL PROTECTED] wrote:
 
 
  Hey all
 
  I recently decided to evaluate Struts2 for a big project, but am
 having
  difficulties mapping actions. I get the There is no Action mapped...
  error
  when I try running the blank struts2 application.
 
  Here's my example.xml
 
  package name=example namespace=com/bubbleclip/web/example
  extends=struts-default
 
  action name=HelloWorld
  class=com.bubbleclip.web.example.HelloWorld
  result/web/example/HelloWorld.jsp/result
  /action
 
  action name=Login_* method={1}
  class=com.bubbleclip.web.example.Login
  result name=input/example/Login.jsp/result
  result type=redirect-actionMenu/result
  /action
 
  action name=* class=
 com.bubbleclip.web.example.ExampleSupport
  
  result/example/{1}.jsp/result
  /action
 
  !-- Add actions here --
  /package
 
  My directory tree looks like the following:
  application/src/com/bubbleclip/web/example/ExampleSupport.java
  application/src/com/bubbleclip/web/example/HelloWorld.java
  application/src/com/bubbleclip/web/example/Login.java
  application/src/com/bubbleclip/web/example/Login-validation.xml
  application/src/com/bubbleclip/web/example/Package.properties
  application/src/example.xml
  application/src/struts.xml
  application/web/index.html
  application/web/example/HelloWorld.jsp
  application/web/WEB-INF/web.xml
  --
  View this message in context:
 
 http://www.nabble.com/There-is-no-Action-mapped-for-action-name-HelloWorld.unknown-location--tf3362312.html#a9353654
  Sent from the Struts - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
  --
  Hey you! Would you help me to carry the stone? Pink Floyd
 
 

 --
 View this message in context:
 http://www.nabble.com/There-is-no-Action-mapped-for-action-name-HelloWorld.unknown-location--tf3362312.html#a9354348
 Sent from the Struts - User mailing list archive at Nabble.com.


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


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

-- 
View this message in context: 
http://www.nabble.com/There-is-no-Action-mapped-for-action-name-HelloWorld.unknown-location--tf3362312.html#a9355632
Sent from the Struts - User mailing list archive at Nabble.com.


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