Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 18 Jun 2008 20:23:20 -0000 Issue 8097

user-digest-help

2008-06-18


Author LoginPost Reply

user Digest 18 Jun 2008 20:23:20 -0000 Issue 8097

Topics (messages 187769 through 187798):

Re: Notify topics in struts2.1.2
 187769 by: Musachy Barroso
 187772 by: Owen Berry
 187773 by: Jan Froehlich

retriving polish characters from URL Query string
 187770 by: Raghuveer
 187771 by: Lukasz Lenart

Re: default result name other than SUCCESS?
 187774 by: Chris Pratt
 187775 by: Lukasz Lenart
 187776 by: Dave Newton
 187778 by: Lukasz Lenart
 187782 by: Dave Newton
 187789 by: Lukasz Lenart

Wildcard mappings with subdirectories / folders?
 187777 by: Dave Belfer-Shevett
 187779 by: Lukasz Lenart
 187780 by: Dave Belfer-Shevett
 187781 by: Dave Newton

simple struts tag to eval OGNL
 187783 by: Brad A Cupit
 187785 by: Musachy Barroso
 187787 by: Brad A Cupit
 187790 by: Lukasz Lenart
 187791 by: Brad A Cupit
 187792 by: Lukasz Lenart
 187795 by: Brad A Cupit
 187796 by: Lukasz Lenart

redirectAction and forwarding actionErrors & actionMessages
 187784 by: Giovanni Azua
 187788 by: Owen Berry

Re: RestActionMapper
 187786 by: stanlick
 187793 by: Dave Newton

Logging For SEVERE: Error filterStart
 187794 by: Paul Zepernick
 187797 by: Dave Newton
 187798 by: Paul Zepernick

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)

----------------------------------------------------------------------

Attachment: user_187769.ezm (zipped)
Pushing my memory to the limit: I think it is the DOM object (in this
case the anchor), that triggered the topic. You can also pass
parameters to topics, check Dojo's documentation.

musachy

On Wed, Jun 18, 2008 at 10:51 AM, Jan Froehlich
<Jan.Froehlich@(protected):
> Perfect, that solves most of the problems I had.
> Thank you!!!
> - but one thing is finally left. ;)
>
> When I subscribe to a topic with something like
> dojo.event.topic.subscribe("documentSelected", function documentSelected(doc) {
>     alert(doc);
> });
> then doc is a object. What kind of object is that, when I notify the topic from a common <a ...> tag?
>
> Kind regards
> Jan
>
> -----Ursprüngliche Nachricht-----
> Von: Musachy Barroso [mailto:musachy@(protected)]
> Gesendet: Mittwoch, 18. Juni 2008 16:26
> An: Struts Users Mailing List
> Betreff: Re: Notify topics in struts2.1.2
>
> Well, now I see something I missed before. notifyTopics are triggered
> when an "ajax" request is done, which is not the case here (there is
> no href), so I think the topics won't be triggered in that case. One
> of the many things you can do is:
>
> <a onclick="dojo.event.topic.publish('documentSelected'); return false">....
>
> You are not really taking advantage of the functionality of the <sx:a
> tag, so you can use a regular anchor for that part.
>
> musachy
>
> On Wed, Jun 18, 2008 at 9:58 AM, Jan Froehlich
> <Jan.Froehlich@(protected):
>> Hi Musachy,
>>
>> thanks for that hint, I tried both, but if you say that it doesn't matter I might have another problem - it worked with neither solution.
>>
>> Do you think that
>> <sx:a notifyTopics="documentSelected"><s:property value="Name" /></sx:a>
>> should be enough to trigger that topic update??
>>
>> Thanks in advance!
>> Regards
>> Jan Froehlich
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Musachy Barroso [mailto:musachy@(protected)]
>> Gesendet: Mittwoch, 18. Juni 2008 15:21
>> An: Struts Users Mailing List
>> Betreff: Re: Notify topics in struts2.1.2
>>
>> I don't think it really matters where you put the code (topic
>> subscription), but it will be easier to put it in the main page that
>> has the tree.
>>
>> musachy
>>
>> On Wed, Jun 18, 2008 at 5:32 AM, Jan Froehlich
>> <Jan.Froehlich@(protected):
>>> Hi,
>>>
>>> I need a little hint how I can achieve the following...
>>> Right now I got a page with a <sx:tree ...> where the user can browse
>>> categories. When a node is clicked a <div id="documentList" ...> loads
>>> another page with a listing of documents in that category. (Just like in
>>> the showcase example but with a little more information in the div)
>>> Every document(-link) should notify another topic that forces a third
>>> <div id="documentContent" ..."> in the page to show the content of the
>>> document.
>>>
>>> And thats where my problem occurs. In the document list I got the
>>> following link for every document
>>>
>>> <sx:a notifyTopics="documentSelected"><s:property value="Name" /></sx:a>
>>>
>>> Where should I place the code? In the page where the tree and the divs
>>> are, or in the page that is loaded after selecting a node?
>>>
>>>   dojo.event.topic.subscribe("documentSelected", function
>>> documentSelected(node) {
>>>           alert(node);
>>>   });
>>>
>>> And maybe more important - I derived the subscribe code from the
>>> nodeSelected example - is it correct that this function has also just
>>> one parameter???
>>>
>>> Any help apreciated!
>>>
>>> Regards
>>> Jan Froehlich
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>
>>
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>



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

Attachment: user_187772.ezm (zipped)
If you have trouble with the dojo documentation, you can use
"dojo.debug(arguments.length)" to tell how many arguments you get
passed, and then use alert/dojo.debug to display obj.toString() or
obj.toSource() ... this will give you an idea of what you're getting
passed.

Owen

On Wed, Jun 18, 2008 at 10:55 AM, Musachy Barroso <musachy@(protected):
> Pushing my memory to the limit: I think it is the DOM object (in this
> case the anchor), that triggered the topic. You can also pass
> parameters to topics, check Dojo's documentation.
>
> musachy
>
> On Wed, Jun 18, 2008 at 10:51 AM, Jan Froehlich
> <Jan.Froehlich@(protected):
>> Perfect, that solves most of the problems I had.
>> Thank you!!!
>> - but one thing is finally left. ;)
>>
>> When I subscribe to a topic with something like
>> dojo.event.topic.subscribe("documentSelected", function documentSelected(doc) {
>>     alert(doc);
>> });
>> then doc is a object. What kind of object is that, when I notify the topic from a common <a ...> tag?
>>
>> Kind regards
>> Jan
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Musachy Barroso [mailto:musachy@(protected)]
>> Gesendet: Mittwoch, 18. Juni 2008 16:26
>> An: Struts Users Mailing List
>> Betreff: Re: Notify topics in struts2.1.2
>>
>> Well, now I see something I missed before. notifyTopics are triggered
>> when an "ajax" request is done, which is not the case here (there is
>> no href), so I think the topics won't be triggered in that case. One
>> of the many things you can do is:
>>
>> <a onclick="dojo.event.topic.publish('documentSelected'); return false">....
>>
>> You are not really taking advantage of the functionality of the <sx:a
>> tag, so you can use a regular anchor for that part.
>>
>> musachy
>>
>> On Wed, Jun 18, 2008 at 9:58 AM, Jan Froehlich
>> <Jan.Froehlich@(protected):
>>> Hi Musachy,
>>>
>>> thanks for that hint, I tried both, but if you say that it doesn't matter I might have another problem - it worked with neither solution.
>>>
>>> Do you think that
>>> <sx:a notifyTopics="documentSelected"><s:property value="Name" /></sx:a>
>>> should be enough to trigger that topic update??
>>>
>>> Thanks in advance!
>>> Regards
>>> Jan Froehlich
>>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: Musachy Barroso [mailto:musachy@(protected)]
>>> Gesendet: Mittwoch, 18. Juni 2008 15:21
>>> An: Struts Users Mailing List
>>> Betreff: Re: Notify topics in struts2.1.2
>>>
>>> I don't think it really matters where you put the code (topic
>>> subscription), but it will be easier to put it in the main page that
>>> has the tree.
>>>
>>> musachy
>>>
>>> On Wed, Jun 18, 2008 at 5:32 AM, Jan Froehlich
>>> <Jan.Froehlich@(protected):
>>>> Hi,
>>>>
>>>> I need a little hint how I can achieve the following...
>>>> Right now I got a page with a <sx:tree ...> where the user can browse
>>>> categories. When a node is clicked a <div id="documentList" ...> loads
>>>> another page with a listing of documents in that category. (Just like in
>>>> the showcase example but with a little more information in the div)
>>>> Every document(-link) should notify another topic that forces a third
>>>> <div id="documentContent" ..."> in the page to show the content of the
>>>> document.
>>>>
>>>> And thats where my problem occurs. In the document list I got the
>>>> following link for every document
>>>>
>>>> <sx:a notifyTopics="documentSelected"><s:property value="Name" /></sx:a>
>>>>
>>>> Where should I place the code? In the page where the tree and the divs
>>>> are, or in the page that is loaded after selecting a node?
>>>>
>>>>   dojo.event.topic.subscribe("documentSelected", function
>>>> documentSelected(node) {
>>>>           alert(node);
>>>>   });
>>>>
>>>> And maybe more important - I derived the subscribe code from the
>>>> nodeSelected example - is it correct that this function has also just
>>>> one parameter???
>>>>
>>>> Any help apreciated!
>>>>
>>>> Regards
>>>> Jan Froehlich
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>>> For additional commands, e-mail: user-help@(protected)
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>
>>
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_187773.ezm (zipped)
Finally I found the matching chapter in the Dojo documentation.
So for everybody's info and completion of this thread:

You can pass parameters to topics with something like

<a onclick="dojo.event.topic.publish('documentSelected', {ID: ${ID}, Kind: '${Kind}' }); return false">
 <s:property value="Name" />
</a>

With that call you can access the properties, of the object passed to the notified function like
dojo.event.topic.subscribe("documentSelected", function documentSelected(doc) {
   dojo.io.bind({
      url: "<s:url value='DocumentViewer.action' />?DocumentId="+doc.ID+"&DocumentType="+doc.Kind,
       load: function(type, data, evt) {
          var divDisplay = dojo.byId("documentContent");
          divDisplay.innerHTML=data;
       },
       mimeType: "text/html"
    });
  });

Maybe that helps someone else and thanks again Musachy!
Regards
Jan

-----Ursprüngliche Nachricht-----
Von: Musachy Barroso [mailto:musachy@(protected)]
Gesendet: Mittwoch, 18. Juni 2008 16:55
An: Struts Users Mailing List
Betreff: Re: Notify topics in struts2.1.2

Pushing my memory to the limit: I think it is the DOM object (in this
case the anchor), that triggered the topic. You can also pass
parameters to topics, check Dojo's documentation.

musachy

On Wed, Jun 18, 2008 at 10:51 AM, Jan Froehlich
<Jan.Froehlich@(protected):
> Perfect, that solves most of the problems I had.
> Thank you!!!
> - but one thing is finally left. ;)
>
> When I subscribe to a topic with something like
> dojo.event.topic.subscribe("documentSelected", function documentSelected(doc) {
>     alert(doc);
> });
> then doc is a object. What kind of object is that, when I notify the topic from a common <a ...> tag?
>
> Kind regards
> Jan
>
> -----Ursprüngliche Nachricht-----
> Von: Musachy Barroso [mailto:musachy@(protected)]
> Gesendet: Mittwoch, 18. Juni 2008 16:26
> An: Struts Users Mailing List
> Betreff: Re: Notify topics in struts2.1.2
>
> Well, now I see something I missed before. notifyTopics are triggered
> when an "ajax" request is done, which is not the case here (there is
> no href), so I think the topics won't be triggered in that case. One
> of the many things you can do is:
>
> <a onclick="dojo.event.topic.publish('documentSelected'); return false">....
>
> You are not really taking advantage of the functionality of the <sx:a
> tag, so you can use a regular anchor for that part.
>
> musachy
>
> On Wed, Jun 18, 2008 at 9:58 AM, Jan Froehlich
> <Jan.Froehlich@(protected):
>> Hi Musachy,
>>
>> thanks for that hint, I tried both, but if you say that it doesn't matter I might have another problem - it worked with neither solution.
>>
>> Do you think that
>> <sx:a notifyTopics="documentSelected"><s:property value="Name" /></sx:a>
>> should be enough to trigger that topic update??
>>
>> Thanks in advance!
>> Regards
>> Jan Froehlich
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Musachy Barroso [mailto:musachy@(protected)]
>> Gesendet: Mittwoch, 18. Juni 2008 15:21
>> An: Struts Users Mailing List
>> Betreff: Re: Notify topics in struts2.1.2
>>
>> I don't think it really matters where you put the code (topic
>> subscription), but it will be easier to put it in the main page that
>> has the tree.
>>
>> musachy
>>
>> On Wed, Jun 18, 2008 at 5:32 AM, Jan Froehlich
>> <Jan.Froehlich@(protected):
>>> Hi,
>>>
>>> I need a little hint how I can achieve the following...
>>> Right now I got a page with a <sx:tree ...> where the user can browse
>>> categories. When a node is clicked a <div id="documentList" ...> loads
>>> another page with a listing of documents in that category. (Just like in
>>> the showcase example but with a little more information in the div)
>>> Every document(-link) should notify another topic that forces a third
>>> <div id="documentContent" ..."> in the page to show the content of the
>>> document.
>>>
>>> And thats where my problem occurs. In the document list I got the
>>> following link for every document
>>>
>>> <sx:a notifyTopics="documentSelected"><s:property value="Name" /></sx:a>
>>>
>>> Where should I place the code? In the page where the tree and the divs
>>> are, or in the page that is loaded after selecting a node?
>>>
>>>   dojo.event.topic.subscribe("documentSelected", function
>>> documentSelected(node) {
>>>           alert(node);
>>>   });
>>>
>>> And maybe more important - I derived the subscribe code from the
>>> nodeSelected example - is it correct that this function has also just
>>> one parameter???
>>>
>>> Any help apreciated!
>>>
>>> Regards
>>> Jan Froehlich
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>
>>
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>



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

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


Attachment: user_187770.ezm (zipped)
Polish characters from other web application.



I had requirement of retrieving the login details like user_id,name from
parent web application.



At present I am retrieving by .



request.getParameter("user_id")

request.getParameter("name")



Some times names can be in Polish language from parent web application.



What changes i need to make in my JSP Struts web application in order to
retrieve the polish characters

From URL by http request with out corruption in characters.



Could you please advice if the following code is correct



Example:



if(request.getParameter("name")!=null){


strTemp = request.getParameter("name");


if(strTemp!=null && !"".equalsIgnoreCase(strTemp)){


strTemp=processText(strTemp);

                                               }

                                               

                                       }







       /**

        * This method is used to process the text coming from
HttpRequest.

        * ISO-8859-1 to UTF-8

        * @param strText

        * @return strResult

        */

        private String processText(String strText){

               String strConvertedMessage =null;

               String strResult=null;

               if(strText!=null && !"".equalsIgnoreCase(strText)){

                       try {

                               strConvertedMessage = new
String(strText.getBytes("ISO-8859-1"), "UTF-8");

                       } catch (UnsupportedEncodingException e)
{

                               // TODO Auto-generated catch
block

                               e.printStackTrace();

                       }



                       strResult=strConvertedMessage;

               }else{

                       strResult=strText;

               }

               return strResult;

        }


Attachment: user_187771.ezm (zipped)
Hi,

First of all, isn't possible to encode Polish characters with
ISO-8859-1, you have to use ISO-8859-2 or UTF-8. It's mean, that the
parent web application has to send user_id, name parameters encoded
with ISO-8859-2 or UTF-8. Without that it will be not possible to
decode such strings.


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

Attachment: user_187774.ezm (zipped)
I'm not sure if the work-around will work. Looking at the code, it
doesn't appear that changing the result type after the action has
executed has any effect.
(*Chris*)

On Wed, Jun 18, 2008 at 6:51 AM, Adam Hardy
<ahardy.struts@(protected):
> I guessed it's not modifiable but I figured I'd ask to make sure.
>
> I like the work-around, hadn't thought of it. I'd probably use it if the
> default result name was going to be configurable in the future (guess
> there's a patch waiting to be coded there).
>
> For now though I just hard coded the name attribute on all my results, not
> big deal.
>
> The reason I asked is that I'm building the example app based on a
> struts-based package, so I was aiming for the ideal.
>
> Thanks
> Adam
>
>
> Gabriel Belingueres on 18/06/08 14:32, wrote:
>>
>> I don't really know if you can change this default, but here is a
>> workaround:
>>
>> Write a custom interceptor that each time your action result is LIST,
>> you change it to SUCCESS.
>>
>> This way you could leave your result tags untouched. However, right
>> now I could not imagine the value of doing that.
>>
>> 2008/6/17, Adam Hardy <ahardy.struts@(protected)>:
>>>
>>> Hi,
>>>
>>> is it possible to do this:
>>>
>>> <action name="category/list"
>>> class="repo.CategoryAction" method="list">
>>> <result>categoryList.tile</result>
>>> </action>
>>>
>>> for result = "LIST" rather than "SUCCESS"? - I mean I want to use LIST
>>> as
>>> the default when none is defined, rather than SUCCESS - I find it more
>>> intuitive for my app.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_187775.ezm (zipped)
Hi,

2008/6/18 Chris Pratt <thechrispratt@(protected)>:
> I'm not sure if the work-around will work. Looking at the code, it
> doesn't appear that changing the result type after the action has
> executed has any effect.

Did you already implement it? Could you show the code?
It should be the last interceptor in the stack.

my snippet for intrecept(ActionInvocation invocation)

String result = invocation.invoke();
if (Action.SUCCESS.equals(result)) {
  result = LIST;
}
return result;


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

Attachment: user_187776.ezm (zipped)
The result has already been rendered after invoke() has been called.

PreResultListener is where to look--although I don't as that would work either. I think both solutions are sub-optimal and not worth it.

--- On Wed, 6/18/08, Lukasz Lenart <lukasz.lenart@(protected):

> From: Lukasz Lenart <lukasz.lenart@(protected)>
> Subject: Re: default result name other than SUCCESS?
> To: "Struts Users Mailing List" <user@(protected)>
> Date: Wednesday, June 18, 2008, 12:48 PM
> Hi,
>
> 2008/6/18 Chris Pratt <thechrispratt@(protected)>:
> > I'm not sure if the work-around will work.
> Looking at the code, it
> > doesn't appear that changing the result type after
> the action has
> > executed has any effect.
>
> Did you already implement it? Could you show the code?
> It should be the last interceptor in the stack.
>
> my snippet for intrecept(ActionInvocation invocation)
>
> String result = invocation.invoke();
> if (Action.SUCCESS.equals(result)) {
>   result = LIST;
> }
> return result;
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail:
> user-help@(protected)

Attachment: user_187778.ezm (zipped)
> The result has already been rendered after invoke() has been called.

Are you sure? I think it wasn't.


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

Attachment: user_187782.ezm (zipped)
--- On Wed, 6/18/08, Lukasz Lenart <lukasz.lenart@(protected):
> newton.dave@(protected):
>> The result has already been rendered after invoke() has been called.
> Are you sure?

Yes. This is pretty fundamental for interceptors, AFAIK.

http://struts.apache.org/2.x/docs/writing-interceptors.html

Dave


Attachment: user_187789.ezm (zipped)
> Yes. This is pretty fundamental for interceptors, AFAIK.
>
> http://struts.apache.org/2.x/docs/writing-interceptors.html

Wow! I've been reading such page many times, but I see such note first
time ;-) Thanks to open my eyes!


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

Attachment: user_187777.ezm (zipped)
Hi folks - I'm trying to divide up my struts app into subdirectories (the
application has a 'public' interface, and an 'administrative' interface
called 'coconut'. Don't ask).

I'd like to have 2 wildcard actions that pull JSPs from different
subdirectories. (coconut and public)

Here's my configs - however, the rules are not matching at all - I have my
JSP's in WEB-INF/jsp/coconut/(blah.jsp) and WEB-INF/jsp/public/(blah.jsp).

   <action name="coconut/*">
     <interceptor-ref name="mystack" />
     <result name="success">/WEB-INF/jsp/coconut/{1}.jsp</result>
     <result name="login">/WEB-INF/jsp/coconut/index.jsp</result>
   </action>
   
   <action name="public/*">
     <interceptor-ref name="mystack" />
     <result name="success">/WEB-INF/jsp/public/{1}.jsp</result>
     <result name="login">/WEB-INF/jsp/public/index.jsp</result>
   </action>
   
No matter what I hit, I get:

SEVERE: Could not find action or result
There is no Action mapped for action name Welcome. - [unknown location]
 at
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186)

Help?

 -dbs

Attachment: user_187779.ezm (zipped)
Hi,

> Here's my configs - however, the rules are not matching at all - I have my
> JSP's in WEB-INF/jsp/coconut/(blah.jsp) and WEB-INF/jsp/public/(blah.jsp).
>
>           <action name="coconut/*">
>                <interceptor-ref name="mystack" />
>                <result name="success">/WEB-INF/jsp/coconut/{1}.jsp</result>
>                <result name="login">/WEB-INF/jsp/coconut/index.jsp</result>
>           </action>
>
>           <action name="public/*">
>                <interceptor-ref name="mystack" />
>                <result name="success">/WEB-INF/jsp/public/{1}.jsp</result>
>                <result name="login">/WEB-INF/jsp/public/index.jsp</result>
>           </action>

You should put your actions to seperate packages with namespaces as you wish

<package name="coconut" namespace="/coconut" extends="struts-default">
  <action name="*">
    <interceptor-ref name="mystack" />
    <result name="success">/WEB-INF/jsp/coconut/{1}.jsp</result>
     <result name="login">/WEB-INF/jsp/coconut/index.jsp</result>
  </action>

</package>

and the same for second action


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

Attachment: user_187780.ezm (zipped)
On Wed, 18 Jun 2008, Dave Belfer-Shevett wrote:
> Hi folks - I'm trying to divide up my struts app into subdirectories (the
> application has a 'public' interface, and an 'administrative' interface
> called 'coconut'. Don't ask).

And here I am answering my own question. A little googling found me this
gem:

<constant name="struts.enable.SlashesInActionNames" value="true" />

And that fixed it. The following action entries work:

>    <action name="coconut/*">
>      <interceptor-ref name="mystack" />
>      <result name="success">/WEB-INF/jsp/coconut/{1}.jsp</result>
>      <result name="login">/WEB-INF/jsp/coconut/index.jsp</result>
>    </action>
>
>    <action name="public/*">
>      <interceptor-ref name="mystack" />
>      <result name="success">/WEB-INF/jsp/public/{1}.jsp</result>
>      <result name="login">/WEB-INF/jsp/public/index.jsp</result>
>    </action>

All fixed, thanks!

 -d

--
-------------------.--------.-------------------------------.
Dave Belfer-Shevett \ KB1FWR \ JID: dbs@(protected) \
blog:planet-geek.com >--------'-----------------------------------.
dbs@(protected) \
-------------------<  your development team: 3) "This code is a   |
            |     piece of crap! You have no honor!"     |
             \______________________________________________/

Attachment: user_187781.ezm (zipped)
That's what I was going to say, but the previous answer of dividing it into namespaces it cleaner, IMO.

Dave


--- On Wed, 6/18/08, Dave Belfer-Shevett <dbs@(protected):

> From: Dave Belfer-Shevett <dbs@(protected)>
> Subject: Re: Wildcard mappings with subdirectories / folders?
> To: "Struts Users Mailing List" <user@(protected)>
> Date: Wednesday, June 18, 2008, 1:12 PM
> On Wed, 18 Jun 2008, Dave Belfer-Shevett wrote:
> > Hi folks - I'm trying to divide up my struts app
> into subdirectories (the
> > application has a 'public' interface, and an
> 'administrative' interface
> > called 'coconut'. Don't ask).
>
> And here I am answering my own question. A little googling
> found me this
> gem:
>
> <constant
> name="struts.enable.SlashesInActionNames"
> value="true" />
>
> And that fixed it. The following action entries work:
>
> >    <action name="coconut/*">
> >      <interceptor-ref name="mystack" />
> >      <result
> name="success">/WEB-INF/jsp/coconut/{1}.jsp</result>
> >      <result
> name="login">/WEB-INF/jsp/coconut/index.jsp</result>
> >    </action>
> >
> >    <action name="public/*">
> >      <interceptor-ref name="mystack" />
> >      <result
> name="success">/WEB-INF/jsp/public/{1}.jsp</result>
> >      <result
> name="login">/WEB-INF/jsp/public/index.jsp</result>
> >    </action>
>
> All fixed, thanks!
>
>  -d
>
> --
> -------------------.--------.-------------------------------.
> Dave Belfer-Shevett \ KB1FWR \ JID:
> dbs@(protected) \
> blog:planet-geek.com
> >--------'-----------------------------------.
> dbs@(protected)
> Klingon on \
> -------------------<  your development team: 3)
> "This code is a   |
>              |     piece of crap! You have no
> honor!"     |
>              
> \______________________________________________/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail:
> user-help@(protected)

Attachment: user_187783.ezm (zipped)
Hi, is there a simple tag I can use to just evaluate some OGNL? For
example, if I have the following line in a JSP it's kind of clunky:

<s:set name="dummyValue" value="%{#map.put(#enum.name(),
#enum.toString())}"/>

does anyone know of a more elegant way?

Brad Cupit
Louisiana State University - UIS



Attachment: user_187785.ezm (zipped)
If you have devMode set to "true", you can add debug=console to your
URL and you will get an OGNL console.

musachy

On Wed, Jun 18, 2008 at 1:32 PM, Brad A Cupit <brad@(protected):
> Hi, is there a simple tag I can use to just evaluate some OGNL? For
> example, if I have the following line in a JSP it's kind of clunky:
>
> <s:set name="dummyValue" value="%{#map.put(#enum.name(),
> #enum.toString())}"/>
>
> does anyone know of a more elegant way?
>
> Brad Cupit
> Louisiana State University - UIS
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>



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

Attachment: user_187787.ezm (zipped)
> If you have devMode set to "true", you can add
> debug=console to your URL and you will get an
> OGNL console.

I didn't know that.
but actually, I was kind of looking for something that would stay in the
page. It wouldn't be for debugging, but some simple logic in the page
for creating the html.

Brad Cupit
Louisiana State University - UIS


-----Original Message-----
From: Musachy Barroso [mailto:musachy@(protected)]
Sent: Wednesday, June 18, 2008 1:08 PM
To: Struts Users Mailing List
Subject: Re: simple struts tag to eval OGNL

If you have devMode set to "true", you can add debug=console to your
URL and you will get an OGNL console.

musachy

On Wed, Jun 18, 2008 at 1:32 PM, Brad A Cupit <brad@(protected):
> Hi, is there a simple tag I can use to just evaluate some OGNL? For
> example, if I have the following line in a JSP it's kind of clunky:
>
> <s:set name="dummyValue" value="%{#map.put(#enum.name(),
> #enum.toString())}"/>
>
> does anyone know of a more elegant way?
>
> Brad Cupit
> Louisiana State University - UIS
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>



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

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


Attachment: user_187790.ezm (zipped)
> I didn't know that.
> but actually, I was kind of looking for something that would stay in the
> page. It wouldn't be for debugging, but some simple logic in the page
> for creating the html.

<s:debug/> ?


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

Attachment: user_187791.ezm (zipped)
Lukasz Lenart wrote:
> <s:debug/>

what I’m really trying to do is have nice integration between s:select and enums. I want a select box with each of the enum choices in it. For this to work, I'd need the enum name as the key in a map, and a user-friendly-string-representation of the enum as the value.

I can't find an easy way to do this with the struts tags. My options seem to be:

a) write code in my action to return this map (what if multiple actions need the same enum? would each action have to extend a super class so as not to duplicate the method?)
b) write a static helper method which takes an enum and returns a map, and call that method from OGNL in the JSP
c) a pure OGNL solution in the JSP
d) write a custom tag

I'll probably go the custom tag route, but when trying the pure OGNL option, the best I could come up with was:

<s:set name="enumMap" value="#{}"/>
<s:iterator id="enum" value="%{@fully.qualified.package.MyEnum@(protected)()}">
  <s:set name="dummyVariable" value="%{#enumMap.put(#enum.name(), #enum.toString())}"/>
</s:iterator>

<s:select name="myEnum" list="%{#enumMap}"/>

Brad Cupit
Louisiana State University - UIS

Attachment: user_187792.ezm (zipped)
Hi,

I'm using something like this:

<s:radio name="employee.employeeType" key="label.employee.type"
list="employeeTypes" listKey="shortcut"
             listValue="name()" required="true"/>

in action I have

  public EmployeeType[] getEmployeeTypes() {
    return EmployeeType.values();
  }

and the enum

public enum EmployeeType
{
  DIRECT("D"),
  INDIRECT("I"),
  OFFICE("O");

  private String shortcut;

  EmployeeType(String shortcut) {
    this.shortcut = shortcut;
  }

  public String getShortcut() {
    return shortcut;
  }

  public String toString() {
    return "EmployeeType{" +
          "shortcut='" + shortcut + '\'' +
          '}';
  }
}


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

Attachment: user_187795.ezm (zipped)
Lukasz Lenart wrote:
> I'm using something like this:
>
> <s:radio name="employee.employeeType" key="label.employee.type"
> list="employeeTypes" listKey="shortcut"
>               listValue="name()" required="true"/>

Oh wonderful! I didn't know that’s what listKey and listValue were for. I was able to take my four lines of JSP and convert them into just one:

<s:select name="myEnum" list="%{@fully.qualified.package.MyEnum@(protected)()"/>

Terrific! Thank you Lukasz!

p.s. to call the static values() method of the enum, struts.ognl.allowStaticMethodAccess must be set to true in struts.properties or struts.xml

Brad Cupit
Louisiana State University - UIS

Attachment: user_187796.ezm (zipped)
> p.s. to call the static values() method of the enum, struts.ognl.allowStaticMethodAccess must be set to true in struts.properties or struts.xml

Thanks, I've also learned something new ;-)


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

Attachment: user_187784.ezm (zipped)
hi,

I basically would like to pass an action message or error from one
action to another using the redirectAction result type.

The use-case is CRUD-related i.e.

1-. displaying a list of X-type beans each one having a link button to
delete it.
2-. once a delete request is submitted, the appropriate action deletes
the element and then does a:
     addActionMessage(StringFormat.format("Element ''{0}'' was
deleted successfully", myElement.getId()));
  then there is a redirect back to the original list where N - 1
elements are displayed. The redirect is needed to
  to clean the request parameters for displaytag to function correctly.

3-. The listX.jsp contains actionerror and actionmessage to provide
feedback to the user.

<s:actionerror />
<s:actionmessage />

My mapping looks like:

    <action name="*@*"
class="com.sag.optimizer.ui.web.action.datamodel.{1}Action" method="{2}">
       <result name="input" type="tiles">webui.form{1}</result>
       <result name="list" type="tiles">webui.list{1}</result>
       <result name="listRedirect" type="redirectAction">
          <param name="actionErrors">${actionErrors}</param>
          <param name="actionMessages">${actionMessages}</param>
          <param name="actionName">{1}@(protected)>
         </result>
       <result name="success"
type="tiles">webui.requestSucceeded</result>
       <result name="error" type="tiles">webui.requestFailed</result>
    </action>

TIA,
regards,
Giovanni

Attachment: user_187788.ezm (zipped)
You probably need to look at storing them in the session. Look at the
MessageStoreInterceptor.

Owen

On Wed, Jun 18, 2008 at 1:38 PM, Giovanni Azua <giaz@(protected):
> hi,
>
> I basically would like to pass an action message or error from one action to
> another using the redirectAction result type.
>
> The use-case is CRUD-related i.e.
>
> 1-. displaying a list of X-type beans each one having a link button to
> delete it.
> 2-. once a delete request is submitted, the appropriate action deletes the
> element and then does a:
>     addActionMessage(StringFormat.format("Element ''{0}'' was deleted
> successfully", myElement.getId()));
>   then there is a redirect back to the original list where N - 1 elements
> are displayed. The redirect is needed to
>   to clean the request parameters for displaytag to function correctly.
>
> 3-. The listX.jsp contains actionerror and actionmessage to provide feedback
> to the user.
>
> <s:actionerror />
> <s:actionmessage />
>
> My mapping looks like:
>
>     <action name="*@*"
> class="com.sag.optimizer.ui.web.action.datamodel.{1}Action" method="{2}">
>       <result name="input" type="tiles">webui.form{1}</result>
>       <result name="list" type="tiles">webui.list{1}</result>
>       <result name="listRedirect" type="redirectAction">
>          <param name="actionErrors">${actionErrors}</param>
>          <param name="actionMessages">${actionMessages}</param>
>          <param name="actionName">{1}@(protected)>
>         </result>
>       <result name="success"
> type="tiles">webui.requestSucceeded</result>
>       <result name="error" type="tiles">webui.requestFailed</result>
>     </action>
>
> TIA,
> regards,
> Giovanni
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_187786.ezm (zipped)

I am looking in the /struts-2.1.2/src/plugins/rest/src/main/java
struts-2.1.2-all.zip. It sounds like Wes has revealed how this works, which
would explain the struts-plugin.xml I am seeing. If this is correct, it
sure sounds like a crazy way to implement a custom "mapper!" Also, why the
variety of "REST" mapper classes in the distribution?




newton.dave wrote:
>
> --- On Tue, 6/17/08, stanlick <stanlick@(protected):
>> Are you looking at the source in
>> /struts-2.1.2/src/plugins/rest/src/main/java?
>
> No, I had been looking in trunk.
>
> S2.1.2, however, doesn't differ from trunk w.r.t. the action mapper (see
> appended diff). The config file wouldn't be in the Java directory, either;
> config files are in the resource directory--not sure what you're looking
> at.
>
> Dave
>
> -- Diff of S2.1.2 v. trunk REST plugin config file
>
> ~/s2/svn $ diff -w trunk/plugins/rest/src/main/resources/struts-plugin.xml
> STRUTS_2_1_2/plugins/rest/src/main/resources/struts-plugin.xml
> 4c4
> < * $Id: struts-plugin.xml 663605 2008-06-05 13:31:01Z musachy $
> ---
>> * $Id: struts-plugin.xml 651946 2008-04-27 13:41:38Z apetrelli $
> 32a33,34
>>     <bean type="com.opensymphony.xwork2.config.PackageProvider"
>> name="rest"
>> class="org.apache.struts2.rest.ControllerClasspathPackageProvider" />
>>
> 45,48c47,48
> <   <!-- Overwrite Codebehind -->
> <   <constant name="struts.codebehind.classSuffix" value="Controller"/>
> <   <constant name="struts.codebehind.action.checkImplementsAction"
> value="false"/>
> <   <constant name="struts.codebehind.action.checkAnnotation"
> value="false"/>
> ---
>>   <!-- Disable the scanning by the codebehind plugin to prevent
>> duplicates -->
>>   <constant name="struts.configuration.classpath.disableActionScanning"
>> value="true" />
> 49a50
>>   <constant name="struts.configuration.rest.disableControllerScanning"
>> value="false" />
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>

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


Attachment: user_187793.ezm (zipped)
--- On Wed, 6/18/08, stanlick <stanlick@(protected):
> I am looking in the
> /struts-2.1.2/src/plugins/rest/src/main/java
> struts-2.1.2-all.zip.

I don't understand; there's no XML in the Java directories of the download (this is from -all):

/tmp/struts-2.1.2/src/plugins/rest $ find . -name "*.xml"
./pom.xml
./src/main/resources/struts-plugin.xml

And that plugin contains the elements I posted previously:

<bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="rest" class="org.apache.struts2.rest.RestActionMapper" />
...
<constant name="struts.mapper.class" value="rest" />

Dave


Attachment: user_187794.ezm (zipped)
How do we correctly setup logging in log4j to capture the problem causing the SEVERE: Error filterStart?  We are trying to add in jasper reporting. We dropped in the jar and receive this error when we configured a jasper result.  We have the log4j.properties in the classpath and have the root logger configured to go to the console.   We are seeing other messages from log4j.  Any advice on how I can get the error causing the filter start to better diagnose the problem?

Thanks,

Paul Zepernick
Information Technology

The information contained in this transmission contains confidential information that is legally privileged. This information is intended only for the use of the individual or entity named above. The authorized recipient of this information is prohibited from disclosing this information to any other party unless required to do so by law or regulation and is required to destroy the information after its stated need has been fulfilled.

If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or action taken in reliance on the contents of these documents is strictly prohibited. If you have received this information in error, please notify the sender immediately by return email and arrange for the return or destruction of these documents.

 


Attachment: user_187797.ezm (zipped)
You *could* set the default log level to DEBUG, but stand back.

My initial assumption, however, would be that you're missing Jasper dependencies, as you say "the jar" and there's around a half-dozen, give or take.

Dave


--- On Wed, 6/18/08, Paul Zepernick <pzepernick@(protected):

> From: Paul Zepernick <pzepernick@(protected)>
> Subject: Logging For SEVERE: Error filterStart
> To: "'user@(protected)>
> Date: Wednesday, June 18, 2008, 3:37 PM
> How do we correctly setup logging in log4j to capture the
> problem causing the SEVERE: Error filterStart? We are
> trying to add in jasper reporting. We dropped in the jar
> and receive this error when we configured a jasper result.
> We have the log4j.properties in the classpath and have the
> root logger configured to go to the console.  We are
> seeing other messages from log4j. Any advice on how I can
> get the error causing the filter start to better diagnose
> the problem?
>
> Thanks,
>
> Paul Zepernick
> Information Technology
>
>
> The information contained in this transmission contains
> confidential information that is legally privileged. This
> information is intended only for the use of the individual
> or entity named above. The authorized recipient of this
> information is prohibited from disclosing this information
> to any other party unless required to do so by law or
> regulation and is required to destroy the information after
> its stated need has been fulfilled.
> If you are not the intended recipient, you are hereby
> notified that any disclosure, copying, distribution, or
> action taken in reliance on the contents of these documents
> is strictly prohibited. If you have received this
> information in error, please notify the sender immediately
> by return email and arrange for the return or destruction
> of these
> documents.---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail:
> user-help@(protected)

Attachment: user_187798.ezm (zipped)
Thanks Dave. I will review the jar dependencies for Jasper.  Right now I have installed the plugin and the jasper 1.3 jar.  I had tried DEBUG already but there was a TON of information to try and sift through and I did not get any kind of stack trace.

Thanks,

Paul Zepernick
Information Technology

-----Original Message-----
From: Dave Newton [mailto:newton.dave@yahoo.com]
Sent: Wednesday, June 18, 2008 4:19 PM
To: Struts Users Mailing List
Subject: Re: Logging For SEVERE: Error filterStart

You *could* set the default log level to DEBUG, but stand back.

My initial assumption, however, would be that you're missing Jasper dependencies, as you say "the jar" and there's around a half-dozen, give or take.

Dave


--- On Wed, 6/18/08, Paul Zepernick <pzepernick@commercebenefitsgroup.com> wrote:

> From: Paul Zepernick <pzepernick@commercebenefitsgroup.com>
> Subject: Logging For SEVERE: Error filterStart
> To: "'user@struts.apache.org'" <user@struts.apache.org>
> Date: Wednesday, June 18, 2008, 3:37 PM
> How do we correctly setup logging in log4j to capture the
> problem causing the SEVERE: Error filterStart?  We are
> trying to add in jasper reporting. We dropped in the jar
> and receive this error when we configured a jasper result.
> We have the log4j.properties in the classpath and have the
> root logger configured to go to the console.   We are
> seeing other messages from log4j.  Any advice on how I can
> get the error causing the filter start to better diagnose
> the problem?
>
> Thanks,
>
> Paul Zepernick
> Information Technology
>
>
> The information contained in this transmission contains
> confidential  information that is legally privileged. This
> information is intended only for the use of the individual
> or entity named above. The authorized recipient of this
> information is prohibited from disclosing this information
> to any other party unless required to do so by law or
> regulation and is required to destroy the information after
> its stated need has been fulfilled.
> If you are not the intended recipient, you are hereby
> notified that any disclosure, copying, distribution, or
> action taken in reliance on the contents of these documents
> is strictly prohibited. If you have received this
> information in error, please notify the sender immediately
> by return email and arrange for the return or destruction
> of these
> documents.---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org

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

The information contained in this transmission contains confidential information that is legally privileged. This information is intended only for the use of the individual or entity named above. The authorized recipient of this information is prohibited from disclosing this information to any other party unless required to do so by law or regulation and is required to destroy the information after its stated need has been fulfilled.

If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or action taken in reliance on the contents of these documents is strictly prohibited. If you have received this information in error, please notify the sender immediately by return email and arrange for the return or destruction of these documents.

 

©2008 gg3721.com - Jax Systems, LLC, U.S.A.