Re: Generate PortletURL object with Struts framework

2013-04-26 Thread Nils-Helge Garli Hegvik
It's been a while since I used it last, but underneath the hood, Struts 2
uses PortletUrl to create urls with the url-tag. So you should be able to
use the param tag to add parameters to the url. If that is not suitable,
use the PortletRequestAware to get the current PortletRequest injected to
your action.

Nils-H

On Fri, Apr 26, 2013 at 11:59 AM, Lukasz Lenart wrote:

> Feel free to request such a functionality via JIRA :-)
>
> https://issues.apache.org/jira/browse/WW
>
>
> Kind regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
>
> 2013/4/26 Juan Jose Fuentes Esteban :
> > It's just what I was afraid of... Well, it could be an interesting
> feature
> > to support in the future, if you ask me. The way it is now, we must
> > generate the PortletURL using the portal API, and after that we have to
> add
> > the parameters that'd make work with Struts2...
> >
> > Thank you Lukasz
> >
> >
> > 2013/4/26 Lukasz Lenart 
> >
> >> 2013/4/24 Juan Jose Fuentes Esteban :
> >> > Which is the preferred way of generating a PortletURL object using
> >> Struts 2
> >> > portlet framework? I have the need to obtain a PortletURL object
> instead
> >> of
> >> > a String because after that I'll need to add parameters to this
> >> PortletURL.
> >>
> >> Hmm... I don't see support for that in Struts2
> >>
> >>
> >> Regards
> >> --
> >> Łukasz
> >> + 48 606 323 122 http://www.lenart.org.pl/
> >>
> >> -
> >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> >> For additional commands, e-mail: user-h...@struts.apache.org
> >>
> >>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: Pluto embedded in Strstu 2.1.8.1

2011-03-16 Thread Nils-Helge Garli Hegvik
Hi!

The Struts2 portlet sample application is set up with the pluto
embedded framework. You can take a look at it to replicate the setup.

Nils-H

On Wed, Mar 16, 2011 at 2:59 PM, Jose Luis Martinez Avial
 wrote:
> Hi,
>    I'm looking how I can integrate an external application available
> through WSRP with our in-house webapp developed with Struts. I would
> like to check how I can embed Pluto in Struts2. Has anyone tried that?
> Is there any documentation or example available?
>
>    TIA
>
> JL
>
>
> Internet communications are not secure and therefore Banco
> Santander International does not accept legal responsibility for
> the contents of this message. Any views or opinions presented
> are solely those of the author and do not necessarily represent
> those of Banco Santander International unless otherwise
> specifically stated.
>
> Las comunicaciones v'ia Internet no son seguras y, por lo tanto,
> Banco Santander International no asume responsabilidad legal
> ni de ning'un otro tipo por el contenido de este mensaje.
> Cualquier opini'on transmitida pertenece 'unicamente al autor y
> no necesariamente representa la opini'on de Banco Santander
> International, a no ser que est'e expresamente detallado.

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



Re: struts2-portlet2-plugin-2.1.8.1 in Liferay 6.0.5 -Post-Redirect-Get aka Redirect after post

2010-12-20 Thread Nils-Helge Garli Hegvik
Did you set the "action-url-redirect" value to "true" in
liferay-portlet.xml as described in the mentioned Lifray bug-report
(http://issues.liferay.com/browse/LEP-1487)?

Nils-H

On Mon, Dec 20, 2010 at 1:22 PM, Galina Angelova  wrote:
> Hello,
>
> I have migrated a portlet application from Lifray 5.2.2 to Liferay 5.2.3 and I
> got the same problem. Does anybody have a solution for version 5.2.3 ? Thanks 
> in
> advance!
>
> Galina
>
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: Alternative UrlRenderer bean

2010-11-15 Thread Nils-Helge Garli Hegvik
You can take a look at how the portlet plugin does this (which was
actually why the UrlRenderer bean was created in the first place). In
addition to defining the bean, you need to tell Struts to use your
renderer:

The portlet plugin does it like this:




Nils-H

On Mon, Nov 15, 2010 at 12:37 PM, GF  wrote:
> Hello everyone.
> i want to use a custom UrlRenderer bean.
> reading Struts2 source code i found that is used to "render" the URLs
> generated by 
>
> If in my struts.xml I insert:
>
>  class="org.apache.struts2.components.MyUrlRenderer"/>
>
> Nothing happens, probably because Struts2 continue to inject the
> renderer with "struts" name.
>
> If in my struts.xml I insert
>
>  class="org.apache.struts2.components.MyUrlRenderer"/>
>
> the struts inizialization fails, since that bean with "struts" name is
> already defined.
>
> Any idea?
>
> Thank you
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: struts2-portlet2-plugin-2.1.8.1 in Liferay 6.0.5 - Post-Redirect-Get aka Redirect after post

2010-10-14 Thread Nils-Helge Garli Hegvik
Maybe this is related (although old): http://issues.liferay.com/browse/LEP-1487

Nils-H

On Thu, Oct 14, 2010 at 6:25 PM, Nils-Helge Garli Hegvik
 wrote:
> I believe it is up to the container how the event -> render transition
> is implemented. I don't think there's any guarantee that it's actualy
> a redirect. If you have several portlets on the page, you could check
> that the transition is ok by clicking on a an action/link in a
> different portlet, and see that only the render phase is executed in
> your struts2 portlet.
>
> Nils-H
>
> On Thu, Oct 14, 2010 at 6:11 PM, Alberto Gallardo  wrote:
>> Hi,
>>
>>> Have you looked at the portlet sample app? It has a few portlet PRG
>>> examples. Try deploying it in Liferay and see if it works as expected.
>>
>> I guess you mean the portlet sample in
>> https://cwiki.apache.org/confluence/display/WW/Struts+2+Portlet+Tutorial
>>
>> Yes, I tried it and tried to debug the portlet and struts2 code; but
>> after a few hours I gave up: As I already mentioned, the PRG works
>> using the
>>   PortletActionContext.getActionResponse().sendRedirect()
>> method call inside an Action.execute.
>>
>> In any case, thanks for your answer.
>>
>> Alberto
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>

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



Re: struts2-portlet2-plugin-2.1.8.1 in Liferay 6.0.5 - Post-Redirect-Get aka Redirect after post

2010-10-14 Thread Nils-Helge Garli Hegvik
I believe it is up to the container how the event -> render transition
is implemented. I don't think there's any guarantee that it's actualy
a redirect. If you have several portlets on the page, you could check
that the transition is ok by clicking on a an action/link in a
different portlet, and see that only the render phase is executed in
your struts2 portlet.

Nils-H

On Thu, Oct 14, 2010 at 6:11 PM, Alberto Gallardo  wrote:
> Hi,
>
>> Have you looked at the portlet sample app? It has a few portlet PRG
>> examples. Try deploying it in Liferay and see if it works as expected.
>
> I guess you mean the portlet sample in
> https://cwiki.apache.org/confluence/display/WW/Struts+2+Portlet+Tutorial
>
> Yes, I tried it and tried to debug the portlet and struts2 code; but
> after a few hours I gave up: As I already mentioned, the PRG works
> using the
>   PortletActionContext.getActionResponse().sendRedirect()
> method call inside an Action.execute.
>
> In any case, thanks for your answer.
>
> Alberto
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: struts2-portlet2-plugin-2.1.8.1 in Liferay 6.0.5 - Post-Redirect-Get aka Redirect after post

2010-10-14 Thread Nils-Helge Garli Hegvik
Hi,

Have you looked at the portlet sample app? It has a few portlet PRG
examples. Try deploying it in Liferay and see if it works as expected.

Nils-H

On Thu, Oct 14, 2010 at 5:52 PM, Alberto Gallardo  wrote:
>>> couldn't get the Post-Redirect-Get (PRG) working. The >> type="redirectAction"> does not translate into a browser redirection.
>
> I couldn't make this working, but...
>
>> I've tried to debug the code, and only could find following method
>> implementation, that suggest me that an http redirection
>> _is_not_supported_:
>>
>> package org.apache.struts2.portlet.servlet;
>> ...
>> public class PortletServletResponse implements HttpServletResponse {
>> ...
>>    public void sendRedirect(String location) throws IOException {
>>        throw new IllegalStateException("Not allowed in a portlet");
>>    }
>>
>> Am I wrong?
>
> ...I found that I can redirect using this method inside an Action.execute():
>
>   PortletActionContext.getActionResponse().sendRedirect(String location)
>
>
> Regards,
>
> Alberto Gallardo
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: How to pass HTTPRequest between two JSP ?

2010-03-01 Thread Nils-Helge Garli Hegvik
That depends. What are you trying to do? What is the purpose of the
submit in the first place? If you just need to execute the second
action directly after the first one, then configure your second action
as a result of the first action.

Nils-H

On Mon, Mar 1, 2010 at 12:12 PM, Frederik Minatchy  wrote:
> Ok! Now I understand a little bit more!
>
> But I will ask you on last question (I hope :) )
> How can I do the same think without creating 2 independents request? It seems 
> that the submit button is not the good choice...
>
> Thank you for your help...
>
>
>
> --- En date de : Lun 1.3.10, Nils-Helge Garli Hegvik  a 
> écrit :
>
>> De: Nils-Helge Garli Hegvik 
>> Objet: Re: How to pass HTTPRequest between two JSP ?
>> À: "Struts Users Mailing List" 
>> Date: Lundi 1 mars 2010, 11h07
>> In that case, you're talking about
>> two entirely independent requests.
>> The request for the first action is no longer accessible
>> for the
>> second action invocation. So in this case your options
>> are:
>>
>> - Store the data as request parameters that you pass on to
>> the next action
>> - Store the data in the session.
>>
>> Nils-H
>>
>>
>> On Mon, Mar 1, 2010 at 11:56 AM, Frederik Minatchy 
>> wrote:
>> > To go from the first action (the execute method) to
>> the second one (supprimerIsbn) I use a submit button in the
>> jsp :
>> >
>> >  > id="supprimerIsbn" type="submit" />
>> >
>> >
>> >
>> >
>> >
>> >
>> > --- En date de : Lun 1.3.10, Nils-Helge Garli Hegvik
>> 
>> a écrit :
>> >
>> >> De: Nils-Helge Garli Hegvik 
>> >> Objet: Re: How to pass HTTPRequest between two JSP
>> ?
>> >> À: "Struts Users Mailing List" 
>> >> Date: Lundi 1 mars 2010, 10h44
>> >> I'm not following the chain of
>> >> actions here... Where's the
>> >> flow/connection between the two actions?
>> >>
>> >> Nils-H
>> >>
>> >> On Mon, Mar 1, 2010 at 11:36 AM, Frederik Minatchy
>> 
>> >> wrote:
>> >> > Perhaps it because of me and the way I
>> understand
>> >> HTTPRequest.
>> >> >
>> >> > Here is an other example :
>> >> >
>> >> >
>> >> > in the class name :
>> >> >
>> >> >
>> >>
>> fr.bnf.platon.bnf.actions.ConsultationEditeurDetailAction
>> >> implementing ServletRequestAware interface
>> >> >
>> >> >
>> >> > when I am in the execute method I do :
>> >> >
>> >> >  public String execute() throws Exception {
>> >> >  ...
>> >> >   request.setAttribute("isbnListe",
>> >> isbnEditeurBeanById); // isbnEditeurBeanById is a
>> map
>> >> > ...
>> >> >
>> >> >    return SUCCESS;
>> >> > }
>> >> >
>> >> > and when I want to suppress element from the
>> map
>> >> stored in the request attribute
>> >> >
>> >> > I do :
>> >> >
>> >> >  public String supprimerIsbn()
>> >> > {
>> >> >   final Map
>> >> allEditorIsbnToRemove =  (Map> >> IsbnEditeurBean>)
>> request.getAttribute("isbnListe"); //
>> >> is null ... why ?
>> >> >     ...
>> >> >    // remove selected elements
>> >> >
>> >> >   return "modification";
>> >> > }
>> >> >
>> >> > in my xml file I have :
>> >> >
>> >> > ...
>> >> >        > >>
>> class="fr.bnf.platon.bnf.actions.ConsultationEditeurDetailAction"
>> >> >
>> >> >                > >>
>> name="input">/pages/bnf/consultationDemandes/detailEditeur.jsp
>> >> >                > name="success"
>> >> type="dispatcher">
>> >> >
>> > >>
>> name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp
>> >> >                
>> >> >                > name="modification"
>> >> type="dispatcher">
>> >> >                        > >>
>> name="location">/pages

Re: How to pass HTTPRequest between two JSP ?

2010-03-01 Thread Nils-Helge Garli Hegvik
In that case, you're talking about two entirely independent requests.
The request for the first action is no longer accessible for the
second action invocation. So in this case your options are:

- Store the data as request parameters that you pass on to the next action
- Store the data in the session.

Nils-H


On Mon, Mar 1, 2010 at 11:56 AM, Frederik Minatchy  wrote:
> To go from the first action (the execute method) to the second one 
> (supprimerIsbn) I use a submit button in the jsp :
>
>  
>
>
>
>
>
>
> --- En date de : Lun 1.3.10, Nils-Helge Garli Hegvik  a 
> écrit :
>
>> De: Nils-Helge Garli Hegvik 
>> Objet: Re: How to pass HTTPRequest between two JSP ?
>> À: "Struts Users Mailing List" 
>> Date: Lundi 1 mars 2010, 10h44
>> I'm not following the chain of
>> actions here... Where's the
>> flow/connection between the two actions?
>>
>> Nils-H
>>
>> On Mon, Mar 1, 2010 at 11:36 AM, Frederik Minatchy 
>> wrote:
>> > Perhaps it because of me and the way I understand
>> HTTPRequest.
>> >
>> > Here is an other example :
>> >
>> >
>> > in the class name :
>> >
>> >
>> fr.bnf.platon.bnf.actions.ConsultationEditeurDetailAction
>> implementing ServletRequestAware interface
>> >
>> >
>> > when I am in the execute method I do :
>> >
>> >  public String execute() throws Exception {
>> >  ...
>> >   request.setAttribute("isbnListe",
>> isbnEditeurBeanById); // isbnEditeurBeanById is a map
>> > ...
>> >
>> >    return SUCCESS;
>> > }
>> >
>> > and when I want to suppress element from the map
>> stored in the request attribute
>> >
>> > I do :
>> >
>> >  public String supprimerIsbn()
>> > {
>> >   final Map
>> allEditorIsbnToRemove =  (Map> IsbnEditeurBean>) request.getAttribute("isbnListe"); //
>> is null ... why ?
>> >     ...
>> >    // remove selected elements
>> >
>> >   return "modification";
>> > }
>> >
>> > in my xml file I have :
>> >
>> > ...
>> >        > class="fr.bnf.platon.bnf.actions.ConsultationEditeurDetailAction"
>> >
>> >                > name="input">/pages/bnf/consultationDemandes/detailEditeur.jsp
>> >                > type="dispatcher">
>> >                         > name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp
>> >                
>> >                > type="dispatcher">
>> >                        > name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp
>> >                
>> >                > type="dispatcher">
>> >                        > name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp
>> >                
>> >        
>> > ...
>> >
>> >
>> > and at least in the jsp :
>> >
>> >
>> > I enter in the "supprimerIsbn" method with the submit
>> button :
>> > ...
>> > > type="submit" />
>> > ...
>> >
>> >
>> > It's true... I can use Session... But after that I
>> have to clean each elements I have set in session
>> >
>> >
>> > I am sure that the dispatch result is a solution...
>> but perhaps I made a mistake in the web.xml file.
>> >
>> > For example why in my url I always have something
>> like
>> >
>> > http://localhost:8080/X/x.jsp and
>> not http://localhost:8080/X/x.action?
>> >
>> >
>> > Fred... Lost in struts2 world :(
>> >
>> >
>> > --- En date de : Lun 1.3.10, Nils-Helge Garli Hegvik
>> 
>> a écrit :
>> >
>> >> De: Nils-Helge Garli Hegvik 
>> >> Objet: Re: How to pass HTTPRequest between two JSP
>> ?
>> >> À: "Struts Users Mailing List" 
>> >> Date: Lundi 1 mars 2010, 9h50
>> >> Either:
>> >>
>> >> - Don't do a redirect, but a regular dispatch [1]
>> >> - Store it in the session
>> >>
>> >> Regards,
>> >>
>> >> Nils-Helge Garli Hegvik
>> >>
>> >> [1] - http://struts.apache.org/2.1.8.1/docs/dispatcher-result.html
>> >&g

Re: How to pass HTTPRequest between two JSP ?

2010-03-01 Thread Nils-Helge Garli Hegvik
I'm not following the chain of actions here... Where's the
flow/connection between the two actions?

Nils-H

On Mon, Mar 1, 2010 at 11:36 AM, Frederik Minatchy  wrote:
> Perhaps it because of me and the way I understand HTTPRequest.
>
> Here is an other example :
>
>
> in the class name :
>
> fr.bnf.platon.bnf.actions.ConsultationEditeurDetailAction implementing 
> ServletRequestAware interface
>
>
> when I am in the execute method I do :
>
>  public String execute() throws Exception {
>  ...
>   request.setAttribute("isbnListe", isbnEditeurBeanById); // 
> isbnEditeurBeanById is a map
> ...
>
>    return SUCCESS;
> }
>
> and when I want to suppress element from the map stored in the request 
> attribute
>
> I do :
>
>  public String supprimerIsbn()
> {
>   final Map allEditorIsbnToRemove =  (Map IsbnEditeurBean>) request.getAttribute("isbnListe"); // is null ... why ?
>     ...
>    // remove selected elements
>
>   return "modification";
> }
>
> in my xml file I have :
>
> ...
>         class="fr.bnf.platon.bnf.actions.ConsultationEditeurDetailAction" >
>                 name="input">/pages/bnf/consultationDemandes/detailEditeur.jsp
>                
>                          name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp
>                
>                
>                         name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp
>                
>                
>                         name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp
>                
>        
> ...
>
>
> and at least in the jsp :
>
>
> I enter in the "supprimerIsbn" method with the submit button :
> ...
> 
> ...
>
>
> It's true... I can use Session... But after that I have to clean each 
> elements I have set in session
>
>
> I am sure that the dispatch result is a solution... but perhaps I made a 
> mistake in the web.xml file.
>
> For example why in my url I always have something like
>
> http://localhost:8080/X/x.jsp and not 
> http://localhost:8080/X/x.action?
>
>
> Fred... Lost in struts2 world :(
>
>
> --- En date de : Lun 1.3.10, Nils-Helge Garli Hegvik  a 
> écrit :
>
>> De: Nils-Helge Garli Hegvik 
>> Objet: Re: How to pass HTTPRequest between two JSP ?
>> À: "Struts Users Mailing List" 
>> Date: Lundi 1 mars 2010, 9h50
>> Either:
>>
>> - Don't do a redirect, but a regular dispatch [1]
>> - Store it in the session
>>
>> Regards,
>>
>> Nils-Helge Garli Hegvik
>>
>> [1] - http://struts.apache.org/2.1.8.1/docs/dispatcher-result.html
>>
>>
>> On Mon, Mar 1, 2010 at 10:40 AM, Frederik Minatchy 
>> wrote:
>> >
>> >
>> > --- En date de : Lun 1.3.10, Alex Rodriguez Lopez
>> 
>> a écrit :
>> >
>> >> De: Alex Rodriguez Lopez 
>> >> Objet: Re: How to pass HTTPRequest between two JSP
>> ?
>> >> À: "Struts Users Mailing List" 
>> >> Date: Lundi 1 mars 2010, 9h21
>> >> Em 28-02-2010 23:26, Frederik
>> >> Minatchy escreveu:
>> >> > Hello...
>> >> >
>> >> > Since a few days I am working with Struts 2.
>> (2.1.6)
>> >> > I am facing a big problem with HttpRequest
>> and JSPs.
>> >> >
>> >> > Well... I have to forward a HTTPRequest from
>> page1.jsp
>> >> to page2.jsp
>> >> >
>> >> > So... How can I pass HTTPRequest attribute
>> betwen 2
>> >> pages?
>> >> >
>> >> > Here is a part my web.xml file :
>> >> >
>> >> > ...
>> >> > 
>> >> >
>> >> struts2
>> >> >
>> >>
>> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
>> >> >      
>> >> >     
>> >> >
>> >> struts2
>> >> >
>> >> /*
>> >> >     
>> >> > ...
>> >> >
>> >> >
>> >> > the struts.xml file :
>> >> >
>> >> > ...
>> >> >
>> >> > > >>
>> class="fr.bnf.platon.bnf.actions.ConsultationBnfDetailAction">
>> >> >
>> >> > >>
>> name="success">/pages/bnf/administration/detailBnf.jsp
>&

Re: How to pass HTTPRequest between two JSP ?

2010-03-01 Thread Nils-Helge Garli Hegvik
Either:

- Don't do a redirect, but a regular dispatch [1]
- Store it in the session

Regards,

Nils-Helge Garli Hegvik

[1] - http://struts.apache.org/2.1.8.1/docs/dispatcher-result.html


On Mon, Mar 1, 2010 at 10:40 AM, Frederik Minatchy  wrote:
>
>
> --- En date de : Lun 1.3.10, Alex Rodriguez Lopez  a 
> écrit :
>
>> De: Alex Rodriguez Lopez 
>> Objet: Re: How to pass HTTPRequest between two JSP ?
>> À: "Struts Users Mailing List" 
>> Date: Lundi 1 mars 2010, 9h21
>> Em 28-02-2010 23:26, Frederik
>> Minatchy escreveu:
>> > Hello...
>> >
>> > Since a few days I am working with Struts 2. (2.1.6)
>> > I am facing a big problem with HttpRequest and JSPs.
>> >
>> > Well... I have to forward a HTTPRequest from page1.jsp
>> to page2.jsp
>> >
>> > So... How can I pass HTTPRequest attribute betwen 2
>> pages?
>> >
>> > Here is a part my web.xml file :
>> >
>> > ...
>> > 
>> >
>> struts2
>> >
>> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
>> >      
>> >     
>> >
>> struts2
>> >
>> /*
>> >     
>> > ...
>> >
>> >
>> > the struts.xml file :
>> >
>> > ...
>> >
>> > > class="fr.bnf.platon.bnf.actions.ConsultationBnfDetailAction">
>> >
>> > name="success">/pages/bnf/administration/detailBnf.jsp
>> >         
>> >
>> >
>> >
>> >         > name="bnf-detail_modification"
>> class="fr.bnf.platon.bnf.actions.ConsultationBnfDetailAction"
>> method="modificationSubmit">
>> >
>> > name="success">/pages/bnf/administration/detailBnf.jsp
>> >         
>> > ...
>> >
>> > and a part of the action java file (which
>> implementents RequestAware):
>> >
>> >    public String execute() throws Exception
>> >     {
>> >        request.put("test", 58);
>> >        return SUCCESS;
>> >      }
>> >
>> >     public String
>> modificationSubmit() throws TechniqueException,
>> FonctionnelleException
>> >     {
>> >        request.get("test"); // is
>> null
>> >        editMode = true;
>> >        return SUCCESS;
>> >     }
>> >
>> >
>> >
>> > So... How can I pass the request attribute from on
>> page to an other?
>> >
>> >
>> >
>> >
>> >
>> >
>> -
>> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> > For additional commands, e-mail: user-h...@struts.apache.org
>> >
>> I think you should be able to redirect with something like
>> this:
>> http://struts.apache.org/2.0.14/docs/redirect-action-result.html
>>
>> use return type redirect-action, work at request level
>> redirecting
>> requests, no jsps. I think request params are retained this
>> way.
>>
>>
>> Regards.
>> Alex Lopez
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>
>
>
> Thank you for your answer...
>
> But as I have to manage passwords I cannot pass values by using Request 
> parameters (as they will appear in the url). I am forced to use Request 
> Attributes. For the moment I am using SessionAware but it is not a good 
> solution. Using Request attributes to store values seem to be a better way. 
> (I remember that it was possible in strut 1.x wasn't it?)
>
>
> I have read that with Dispatch result HTTPRequest was "kept" on the server 
> and was not lost... I am trying to implement things as it is written in 
> documentation but it fails...
>
> I appreciate your help...
>
> Fred
>
>
>
>
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: Custom Window State Struts2 Portlet

2010-02-24 Thread Nils-Helge Garli Hegvik
>From the source [1] (getWindowState method), it appears that only the
standard window states are considered when creating the url.

Please register a JIRA issue (tests and patch welcome indeed).

Regards,

Nils-Helge Garli Hegvik

[1] - 
http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/portlet/src/main/java/org/apache/struts2/portlet/util/PortletUrlHelper.java?view=markup

On Mon, Feb 22, 2010 at 2:47 PM, Ricardo Jorge  wrote:
> Hello.
>
> I'm using Liferay portal to develop a portlet using struts 2. I need to use
> a custom Liferay Window State called exclusive to generate a URL. This
> allows me to make AJAX calls and return only the result generated by the
> action. I have added the  tag to my portlet.xml
>
> I tried
>
> 
>          
> 
>
> but the windowState in the URL always ends up being 'normal' (I presume this
> is the default). I did a quick look through the Struts2 code but I couldn't
> find the place where this default value was processed (I will look in more
> detail later).
>
> I also tried
>
> 
>           value="/gdocs/moreinformation" />
>          
> 
>
> and it works but I need to add a dynamic parameter (id) from the Value Stack
> (I'm using s:iterator) but I have no idea how to put it there. 
> doesn't work, using %{} or ${} doesn't work either.
>
> Finally, I solved this problem the following way
>
> 
>                   value="/gdocs/moreinformation" />
> &id= value="resourceId" />
>
> but it feels kind of hackish and I think that there has to be a better way.
>
> Any suggestions?
>
> Best Regards,
> Ricardo
>

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



Re: Problem with tag

2010-01-18 Thread Nils-Helge Garli Hegvik
Putting it inside  tag might also work.

Nils-H

On Mon, Jan 18, 2010 at 2:12 PM, Dave Newton  wrote:
> VSGoud wrote:
>>
>> Facing problem with  tag.
>> when i fetch the data from one of the columns in a given table, I am able
>> to
>> view the certain parts of the fetched data in new lines in 
>> tag. But, when i tried to view the same fetched data through > />
>> tag, the text isn't appearing in new lines.
>>
>> On viewing the fetched data in sql file the text is appended with "
>> \r\n\r\n" in it. So i guess these ( \r\n\r\n) are not playing any role
>> with
>>  tag where as it is working normally or as desired with
>>  tag
>
> Convert it into HTML.
>
> Dave
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: MySQL + JDBC

2009-12-14 Thread Nils-Helge Garli Hegvik
Have you tried asking over at the MySQL forum? I don't think this is
related to Struts 2.

Nils-H

On Tue, Dec 15, 2009 at 8:26 AM, Todd Grigsby  wrote:
>
>
> (Beating head on keyboard...)
> "So one more time for the folks at home: Is there anyone out there who has
> managed to get MySQL 64-bit to work via ODBC?"
>
> For those who aren't aware, MySQL has an ODBC connector called, oddly
> enough, Connector/ODBC.  In previous versions it was called MyODBC.  It does
> work, as evidenced by the fact that I can connect from Windows apps with
> ease. What doesn't work, and the only thing I'm looking for an answer to is,
> why do I get the error, "The specified DSN contains an architecture mismatch
> between the Driver and Application" when connecting from within Struts 2?
>  But at this point I'd be happy hearing from anyone that has gotten "MySQL
> 64-bit to work via ODBC."
>
> TG
>
> Lee Clemens wrote:
>>
>> Not to sound like a jerk, but have you gotten JDBC (MySQL Connector/J)
>> working with a MySQL 64-bit server?  Or is this specifically a Struts
>> issue?
>> If so, what message/condition do you receive?
>>
>> Or are you merely asking if MySQL 64-bit is compatible with ODBC [OT]?
>>
>>
>> -Original Message-
>> From: Todd Grigsby [mailto:strutsu...@tgrigsby.com] Sent: Monday, December
>> 14, 2009 9:57 PM
>> To: Struts Users Mailing List
>> Subject: Re: MySQL + JDBC
>>
>>
>>
>> Not that I wanted to get into a debate about the usefulness of ODBC, but
>> the Java-based web services we have aren't the only things that connect to
>> these databases, and going through ODBC has been, for the last 10 years, a
>> very nice and consistent way to connect across all our applications and
>> utilities.  We have, at one time or another, supported all of the following:
>>
>>    MySQL
>>    Oracle
>>    SQL Server
>>    Informix
>>    DB2
>>    mSQL
>>    Pervasive SQL
>>    MS Access (pre-Jet)
>>
>> And a few others, and we have connected to these databases via ODBC all
>> along the way.  Keeping the connection mechanism consistent has made
>> development work in a number of languages simple.  So while I certainly
>> appreciate everyone's enthusiasm for talking directly to MySQL, I have a
>> legacy code base that works *REALLY* well through ODBC, and I'd like to
>> stick with it.
>>
>> So one more time for the folks at home: Is there anyone out there who has
>> managed to get MySQL 64-bit to work via ODBC?
>>
>> TG
>>
>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>>
>>
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: struts2 web app without jsp pages, is it possible?

2009-12-08 Thread Nils-Helge Garli Hegvik
The developer could still read the same files in the struts action.
What's the difference?

Nils-H

On Tue, Dec 8, 2009 at 3:21 PM, Shital Patil  wrote:
> Dear All,
>
> Thanks for your valuable suggestions.
> Actually I am failed to convince my PM for using JSP pages in web app.
> He said, there are some serious problems with JSP.
> e.g JSP = presentation + code.
> A JSP developer can easily read some imp file on disk say, /etc/passwd, and
> throw it to the client. How to avoid this problem?
>
>
> Regards,
> Shital
>
> --- On Tue, 8/12/09, Halil Ağın  wrote:
>
> From: Halil Ağın 
> Subject: Re: struts2 web app without jsp pages, is it possible?
> To: "Struts Users Mailing List" 
> Date: Tuesday, 8 December, 2009, 12:56 PM
>
> html+freemarker+json
>
> On Tue, Dec 8, 2009 at 2:12 PM, Saeed Iqbal  wrote:
>
>> You can easily have html extension for your web page and use sitemesh for
>> templating
>>
>> On Tue, Dec 8, 2009 at 5:08 PM, Shital Patil > >wrote:
>>
>>  > Dear All,
>> >
>> > I want to develop web application in struts2 framework but without jsp
>> > pages.
>> > We are going to use HTML template engine for view.
>> > Is it possible to develop web application in struts2 without jsp pages?
>> > Is this a good idea?
>> >
>> >
>> > Regards,
>> > Shital
>> >
>> >
>> >      The INTERNET now has a personality. YOURS! See your Yahoo! Homepage.
>> > http://in.yahoo.com/
>>
>>
>>
>>
>> --
>> Saeed Iqbal
>> Independant Consultant
>> J2EE - Application Architect / Developer
>>
>
>
>
>      The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. 
> http://in.yahoo.com/

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



Re: JSR286 in Struts2

2009-10-22 Thread Nils-Helge Garli Hegvik
It's in the sandbox
(http://svn.apache.org/repos/asf/struts/sandbox/trunk/struts2-portlet2-plugin/).
You can also find some information here:
http://boss.bekk.no/display/BOSS/Struts+2+Portlet+2.0+Plugin

It's exeperimental, and has not been worked on for a while. You're
welcome to test it and report your findings.

Nils-H

On Thu, Oct 22, 2009 at 9:08 AM, Arihara  wrote:
>
> hi all,
>
>          Whether Struts 2 support JSR286 specification portlet
> implementation?If Yes,then where I can find the implementation procedure.
>
> Thanks in advance.
> --
> View this message in context: 
> http://www.nabble.com/JSR286-in-Struts2-tp26005074p26005074.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: urgent guys

2009-10-14 Thread Nils-Helge Garli Hegvik
What happens at
com.xiusbcgi.ui.struts.action.VoyagerDispatchAction.preExecute(VoyagerDispatchAction.java:178)
?

Nils-H

On Wed, Oct 14, 2009 at 1:31 PM, swathi reddy  wrote:
>  Hi  all guys
>
> can u tell me whare exactly this error is being raised in my project
>
> I am using struts 1.3.8
> errror log is like this below :
>
>
> java.lang.NullPointerException
>
> at
> com.xiusbcgi.ui.struts.action.VoyagerDispatchAction.preExecute(VoyagerDispatchAction.java:178)
>
> at
> com.xiusbcgi.ui.struts.action.VoyagerDispatchAction.execute(VoyagerDispatchAction.java:142)
>
> at
> org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
>
> at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
>
> at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
>
> at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>
> at com.xius.common.XIUSFilter.doFilter(XIUSFilter.java:53)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>
> at
> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
>
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>
> at
> org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
>
> at
> org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
>
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>
> at
> org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
>
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
>
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>
> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
>
> at java.lang.Thread.run(Thread.java:595)
>
>
> --
> Thanks& Regards
>
> Swathi
>

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



Re: Portlet form action parameters doubles the namespace of actions

2009-10-13 Thread Nils-Helge Garli Hegvik
I noticed your bug report in JIRA and will be looking into it. As for
debugging, check out the setup in the sample portlet application. I
use it to run portlets embedded in pluto directly in Eclipse. Makes
debugging real easy.

Nils-H

On Fri, Oct 9, 2009 at 10:35 AM, Leonard Broman
 wrote:
> I reconfigured the project not to use the convention plugin and using
> the good old xml-configuration. But the problem persists. I'll try to
> dig into what might be causing this. Is anyone looking actively at the
> portlet plugin? Can anyone give me advice on development tools for
> debugging portlets? The portal I'm working in now i kind of heavy...
>
> 2009/10/8 Leonard Broman :
>> Hi!
>>
>> I'm building a simple portlet using struts 2.1.8 with convention and
>> the portlet plugin.
>> I have an issue where is seems that the action url (submit url) has a
>> doubled namespace like:
>>
>> Here's the query string:
>>
>> ?struts.portlet.mode=config&dynamicAttributes=%7B%7D&sv.mode=config&struts.portlet.action=/email/config/email/config/config&templateDir=template&theme=simple
>>
>> From this I can see that it gets the /email/config/email/config
>> namespace instead of just /email/config. Not unexpected, struts throws
>> an exception about action not found when submit is clicked. This is
>> only while running as a portlet, as webapp (test) everything works
>> fine.
>>
>> Anyone has any clues?
>>
>> Leonard broman
>>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: Problem Using Struts 2.1.8 Portlet Plugin With redirectAction

2009-10-05 Thread Nils-Helge Garli Hegvik
Yes, that was what I meant, and I worked just fine with me, using your
web application (on Jetty/pluto). I haven't had time looking any more
into it, but I'll keep you updated.

Nils-H

On Fri, Oct 2, 2009 at 3:40 PM, phillips1021  wrote:
>
> Nils - I'm not following how to implement your quick fix.  Do you mean I
> should do this:
>
>                        
>                                index.action
>                        
>
> I tried the above and it didn't work for me.
>
> Thank you for researching this issue so quickly.  We would like to move to
> Struts 2.1.8 (we are still on 2.0.14 for our Struts 2 applications that are
> also portlets.
>
> Bruce
>
>
> Definitively a bug somewhere. A quick fix is to add ".action" in the
> configuration for the redirectAction result.
> --
> View this message in context: 
> http://www.nabble.com/Problem-Using-Struts-2.1.8-Portlet-Plugin-With-redirectAction-tp25702898p25716027.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: Problem Using Struts 2.1.8 Portlet Plugin With redirectAction

2009-10-01 Thread Nils-Helge Garli Hegvik
Definitively a bug somewhere. A quick fix is to add ".action" in the
configuration for the redirectAction result. Something has changed
from 2.1.6 and 2.1.8 that caused this. I'll investigate further. It
also fails in the sample portlet application, which I did click
through before 2.1.8...

Nils-H

On Thu, Oct 1, 2009 at 7:52 PM, Nils-Helge Garli Hegvik
 wrote:
> It Should work with redirectAction. I'll look into it.
>
> Nils-H
>
> On Thu, Oct 1, 2009 at 7:28 PM, phillips1021  wrote:
>>
>> I changed my struts.xml configuration to use type chain instead of type
>> redirectAction
>>
>>                > class="com.struts2.tutorial.action.EmployeeAction" method="delete">
>>                        index
>>                        > name="input">/portlet/employeeFormPortlet.jsp
>>                
>>
>> and now it works.
>>
>> So despite the warning about using type="chain" here:
>>
>> http://struts.apache.org/2.1.8/docs/action-chaining.html
>> http://struts.apache.org/2.1.8/docs/action-chaining.html
>>
>> is it appropriate to use type="chain" for a Struts 2 portlet application?
>>
>> Bruce
>>
>>
>> I have a Struts 2 portlet application that works fine using Struts 2.0.14.
>>
>> We could not get it to work using 2.1.6 and the 2.1.6 portlet plugin due to
>> the problem the 2.1.6 portlet plugin version had with the s:form tag (see
>> http://www.nabble.com/Error-when-deploying-portlets-beside-a-normal-Struts2-web-app--tc23981728.html#a24117787
>> http://www.nabble.com/Error-when-deploying-portlets-beside-a-normal-Struts2-web-app--tc23981728.html#a24117787
>> (JIRA Issue WW-3164).
>>
>> Now that Struts 2.1.8 is out I wanted to use that version in my Struts 2
>> portlet application.
>>
>> After upgrading my pom.xml to 2.1.8 and adding the dependency for the 2.1.8
>> portlet plugin I rebuild and tested my Struts 2 portlet application.
>>
>> Struts 2.1.8 portlet plugin fixed the issue with the s:form tag.  However,
>> now my actions for the portlet view that use type="redirectAction" fail.
>> --
>> View this message in context: 
>> http://www.nabble.com/Problem-Using-Struts-2.1.8-Portlet-Plugin-With-redirectAction-tp25702898p25703292.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>

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



Re: Problem Using Struts 2.1.8 Portlet Plugin With redirectAction

2009-10-01 Thread Nils-Helge Garli Hegvik
It Should work with redirectAction. I'll look into it.

Nils-H

On Thu, Oct 1, 2009 at 7:28 PM, phillips1021  wrote:
>
> I changed my struts.xml configuration to use type chain instead of type
> redirectAction
>
>                 class="com.struts2.tutorial.action.EmployeeAction" method="delete">
>                        index
>                         name="input">/portlet/employeeFormPortlet.jsp
>                
>
> and now it works.
>
> So despite the warning about using type="chain" here:
>
> http://struts.apache.org/2.1.8/docs/action-chaining.html
> http://struts.apache.org/2.1.8/docs/action-chaining.html
>
> is it appropriate to use type="chain" for a Struts 2 portlet application?
>
> Bruce
>
>
> I have a Struts 2 portlet application that works fine using Struts 2.0.14.
>
> We could not get it to work using 2.1.6 and the 2.1.6 portlet plugin due to
> the problem the 2.1.6 portlet plugin version had with the s:form tag (see
> http://www.nabble.com/Error-when-deploying-portlets-beside-a-normal-Struts2-web-app--tc23981728.html#a24117787
> http://www.nabble.com/Error-when-deploying-portlets-beside-a-normal-Struts2-web-app--tc23981728.html#a24117787
> (JIRA Issue WW-3164).
>
> Now that Struts 2.1.8 is out I wanted to use that version in my Struts 2
> portlet application.
>
> After upgrading my pom.xml to 2.1.8 and adding the dependency for the 2.1.8
> portlet plugin I rebuild and tested my Struts 2 portlet application.
>
> Struts 2.1.8 portlet plugin fixed the issue with the s:form tag.  However,
> now my actions for the portlet view that use type="redirectAction" fail.
> --
> View this message in context: 
> http://www.nabble.com/Problem-Using-Struts-2.1.8-Portlet-Plugin-With-redirectAction-tp25702898p25703292.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: Wondering that Struts2 is getting die?

2009-09-30 Thread Nils-Helge Garli Hegvik
Now that is an impressive conclusion I didn't catch that, since I
was reading the lines instead of between them...

Nils-H

On Wed, Sep 30, 2009 at 3:25 PM, Martin Gainty  wrote:
>
> if i read between the lines i think hes speaking of the hardcoded xwork 
> dependency
> there are rumours (that I am spreading) about incorporating different 
> Interceptor libraries (e.g. Spring)
> as this is decidedly non-trivial undertaking this would involve a major 
> revision (not a point release) refactoring
>
> Martin Gainty
> __
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
> sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
> oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich 
> dem Austausch von Informationen und entfaltet keine rechtliche 
> Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen 
> wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
> destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
> l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci 
> est interdite. Ce message sert à l'information seulement et n'aura pas 
> n'importe quel effet légalement obligatoire. Étant donné que les email 
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter 
> aucune responsabilité pour le contenu fourni.
>
>
>
>
>> Date: Wed, 30 Sep 2009 13:15:58 +0200
>> Subject: Re: Wondering that Struts2 is getting die?
>> From: nil...@gmail.com
>> To: user@struts.apache.org
>>
>> If you check out the dev mailing list, you'll see that there's
>> currently a vote for 2.1.8. That doesn't look like dead to me...
>>
>> Nils-H
>>
>> On Wed, Sep 30, 2009 at 1:12 PM, karaatli  wrote:
>> >
>> > Hi all,
>> > Due to out of date struts wiki page, confllunece page & others relating to
>> > struts2 I am questioning myself  what about  Struts2 future days?
>> >
>> > Or
>> >
>> > Why there is no update at these pages?
>> >
>> > --
>> > View this message in context: 
>> > http://www.nabble.com/Wondering-that-Struts2-is-getting-die--tp25679069p25679069.html
>> > Sent from the Struts - User mailing list archive at Nabble.com.
>> >
>> >
>> > -
>> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> > For additional commands, e-mail: user-h...@struts.apache.org
>> >
>> >
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>
> _
> Lauren found her dream laptop. Find the PC that’s right for you.
> http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290

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



Re: Wondering that Struts2 is getting die?

2009-09-30 Thread Nils-Helge Garli Hegvik
If you check out the dev mailing list, you'll see that there's
currently a vote for 2.1.8. That doesn't look like dead to me...

Nils-H

On Wed, Sep 30, 2009 at 1:12 PM, karaatli  wrote:
>
> Hi all,
> Due to out of date struts wiki page, confllunece page & others relating to
> struts2 I am questioning myself  what about  Struts2 future days?
>
> Or
>
> Why there is no update at these pages?
>
> --
> View this message in context: 
> http://www.nabble.com/Wondering-that-Struts2-is-getting-die--tp25679069p25679069.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: How to import a struts 2 action into a jsp?

2009-09-24 Thread Nils-Helge Garli Hegvik
Can't you use the s:action tag? Anyway, this might have something to
do with filter configuration. Try adding this to the filter definition
in web.xml:

REQUEST
INCLUDE
FORWARD

Nils-H

On Thu, Sep 24, 2009 at 11:18 AM, Per Johansson  wrote:
> Hi,
>
> I am new to Struts and want to import a Struts 2 action into a jsp by
> jstl import:
>        
> But neither Tomcat nor Jboss seem to like this - but gives the reply:
> Importing /HelloWorld_input.action: The requested resource
> (/HelloImport/HelloWorld_input.action) is not available
>
> Using c:import does not seem to trigger the processing of the struts
> filter dispatcher.
>
> If I import via an intermediate jsp instead, it works:
> 
>
> With hello.jsp:
> ---
>    
>        
>            
>            
>        
>    
> ---
>
> And struts.xml:
> 
>    
>        
>            /hello.jsp
>        
>        
>            /success.jsp
>        
>    
> 
>
>
> With Struts you should never access jsp:s directly, but always work
> with actions.
> Is there any trick to import a Struts 2 action directly into a JSP?
>
>
> /Best regards, Per Johansson
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: using struts taglib how to find the lenght of an parameter

2009-09-17 Thread Nils-Helge Garli Hegvik
A simple way to achieve that is to have a property on the form bean
that returns the username appropriate for display.

Nils-H

On Thu, Sep 17, 2009 at 2:35 PM, swathi reddy  wrote:
>  Hi all
>
> I am trying to display a user name through  tag but before that
> I want to check the lenght of the name so that   I can trim the name if it
> exceeds 20 charecters.
>
>
> --
> Thanks& Regards
>
> Swathi
>

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



Re: Testing with Spring + Struts 2 + TestNG

2009-09-11 Thread Nils-Helge Garli Hegvik
If it's unit testing you want to do, can't you just test your actions
without involving Spring or anything else? I usually just create a
unit test where I instantiate my action, set the aproriate
dependencies, and then just call the appropriate execute method.

Nils-H

2009/9/11 Diego Manilla Suárez :
> Hi. I've been struggling to have tests for my Struts 2 actions working.
>
> I'm using Struts 2 actions created by Spring, by the means of the Struts 2
> Spring plugin.
>
> Both Struts 2 and Spring provide their own base classes to create test
> units, and since Java doesn't allow multiple inheritance, I've tried to
> extend one of the classes and trying to replicate the functionality provided
> by the other, with no luck so far, I get all kinds of obscure errors,
> especially from the Struts 2 part.
>
> I also want to use TestNG, not JUnit.
>
> I was wondering if there is a base class anywhere to create unit tests for
> Struts 2 actions inside Spring.
>
> Thanks in advance.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: [struts2] disable parameter pass between actions

2009-09-09 Thread Nils-Helge Garli Hegvik
How do you create the url (seeing some code would help...), and which
version of S2? If you're using the url-tag, try setting the
includeParams attribute to "none".

http://struts.apache.org/2.1.6/docs/url.html

Nils-H


2009/9/9 Halil Ağın :
> Hello List;
>
> I have 2 urls as below
>
> /myapp/myaction1.action?p=3
> /myapp/myacction2.action
>
> i reqeust the first action with param as above. when first request completed
> i click a button which request second action. but when second action is
> requested, the parameter part is also passed to second action. the second
> action is requested as /myapp/myacction2.action?p=3, which i dont want. i
> dont want parameter passing.
>
> i search the net, but documents shows how parameter passing is done. i
> couldnt find any document about disabling parameter passing.
>
> how could i disable paramter passing?.
>
> regards,
>
> -Halil AĞIN
>

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



Re: Strut2 Picture Upload question: Please Help!

2009-09-03 Thread Nils-Helge Garli Hegvik
A form with file input can't be submitted with Ajax. You either have
to do some iframe magic or use a flash component. Do a google search
for "ajax file upload" to find some options. I've been using SWFUpload
[1] for this purpose.

Nils-H

[1] - http://code.google.com/p/swfupload/

On Thu, Sep 3, 2009 at 1:49 AM, hisameer wrote:
>
> Thanks for your comment. But my question is How can it be done using AJAX? I
> am using dojo plugin in my struts application. But if I use  type="file" name="docs" value="Brows" width="400px"/>
> then it also shows the brows location as well. But in my case its only a
> simple upload button.What should I do?
>
> And initially there has to be a placeholder for those pictures as well.
>
> I am totally confused. Please help!
>
>
>
> Lee Clemens-4 wrote:
>>
>> Maybe have the Upload buttons refresh the page? And load the images from
>> the
>> action?
>>
>> Otherwise it would have to be done client side (ajax?)
>>
>> -Original Message-
>> From: hisameer [mailto:cool_sameer_fo...@yahoo.com]
>> Sent: Wednesday, September 02, 2009 6:27 PM
>> To: user@struts.apache.org
>> Subject: Strut2 Picture Upload question: Please Help!
>>
>>
>> I am using Struts 2.1.6 and in my application I have a requirement where
>> the
>> user can upload four pictures of his vehicle.In my JSP, there will be four
>> upload buttons corresponding to those four pics(As shown in the below
>> image). After the user is done selecting the file it should be uploaded in
>> the JSP right away.
>>
>> Below image shows the actual display of the requirement.
>>
>>
>> http://www.nabble.com/file/p25266760/picUploading.jpg
>>
>>
>> Can somebody put some sample code for this kind of requirement or suggest
>> me
>> what should I do? I am sure this is just a simple requirement but I am not
>> able to crack it.
>> --
>> View this message in context:
>> http://www.nabble.com/Strut2-Picture-Upload-question%3A-Please-Help%21-tp252
>> 66760p25266760.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Strut2-Picture-Upload-question%3A-Please-Help%21-tp25266760p25267581.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: Need to disable session interceptor

2009-09-01 Thread Nils-Helge Garli Hegvik
> I am trying to find out why is the session created when I did not create
> the session in my code.
>
> --
> Rajeev
>

Well, I believe Struts 2 internally does request.getSession(false) to
prevent creating sessions when there isn't one... Which interceptor
stack are you using? You could also try adding <% @page session=false
%> in your JSPs and see if that helps.

Nils-H

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



[OT] Re: Need to disable session interceptor

2009-09-01 Thread Nils-Helge Garli Hegvik
Hm... I don't know... Maybe read the documentation?

http://jakarta.apache.org/jmeter/usermanual/component_reference.html#HTTP_Cookie_Manager

Sorry for pinging you online. Hope that's not too much trouble...

Nils-H

On Tue, Sep 1, 2009 at 3:23 PM, Martin Gainty wrote:
>
> Nils-
>
> doc suggests implementing a HttpCookieManager to handle the session
> any suggestions on which HttpCookieManager to implement and possible 
> configurations?
>
> (i think JMeter is O/T so please ping offline)
>
> thanks
> Martin Gainty
> __
> Note de déni et de confidentialité
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
> destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
> l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci 
> est interdite. Ce message sert à l'information seulement et n'aura pas 
> n'importe quel effet légalement obligatoire. Étant donné que les email 
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter 
> aucune responsabilité pour le contenu fourni.
>
>
>
>
>> Date: Tue, 1 Sep 2009 13:19:22 +0200
>> Subject: Re: Need to disable session interceptor
>> From: nil...@gmail.com
>> To: user@struts.apache.org
>>
>> From the JMeter FAQ: "How do I ensure each http request for jsp is
>> within one jsessionid ?"
>>
>> http://wiki.apache.org/jakarta-jmeter/JMeterFAQ#head-114aca8407cf0eaff55b7ae5955eda46b1e2cecb
>>
>> Nils-H
>>
>> On Tue, Sep 1, 2009 at 1:15 PM, Dave Newton wrote:
>> > Rajeev Sharma wrote:
>> >>
>> >> I am new to struts2 (I mean struts). I am developing an application which
>> >> does not need to use sessions at all. When I tested my application with
>> >> jmeter, I got 18000 sessions created (tomcat showed me this). Looks like 
>> >> for
>> >> every individual request there is one session created. How can I remove 
>> >> the
>> >> session interceptor at all (and other components related to sessions), so
>> >> that there are no sessions created in my application.
>> >
>> > There isn't a session created for each request, there's a session per 
>> > client
>> > conversation. Also, AFAIK, Struts 2 doesn't do anything in particular
>> > regarding session creation--that is handled by the container.
>> >
>> > Dave
>> >
>> >
>> > -
>> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> > For additional commands, e-mail: user-h...@struts.apache.org
>> >
>> >
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>
> _
> Get back to school stuff for them and cashback for you.
> http://www.bing.com/cashback?form=MSHYCB&publ=WLHMTAG&crea=TEXT_MSHYCB_BackToSchool_Cashback_BTSCashback_1x1

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



Re: Need to disable session interceptor

2009-09-01 Thread Nils-Helge Garli Hegvik
>From the JMeter FAQ: "How do I ensure each http request for jsp is
within one jsessionid ?"

http://wiki.apache.org/jakarta-jmeter/JMeterFAQ#head-114aca8407cf0eaff55b7ae5955eda46b1e2cecb

Nils-H

On Tue, Sep 1, 2009 at 1:15 PM, Dave Newton wrote:
> Rajeev Sharma wrote:
>>
>> I am new to struts2 (I mean struts). I am developing an application which
>> does not need to use sessions at all. When I tested my application with
>> jmeter, I got 18000 sessions created (tomcat showed me this). Looks like for
>> every individual request there is one session created. How can I remove the
>> session interceptor at all (and other components related to sessions), so
>> that there are no sessions created in my application.
>
> There isn't a session created for each request, there's a session per client
> conversation. Also, AFAIK, Struts 2 doesn't do anything in particular
> regarding session creation--that is handled by the container.
>
> Dave
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: How to print out method result called into execute() on a JSP page

2009-09-01 Thread Nils-Helge Garli Hegvik
Take a look at this tutorial:
http://www.laliluna.de/first-steps-using-struts-tutorial.html

There are more tutorials at http://wiki.apache.org/struts/StrutsTutorials

Nils-H

On Tue, Sep 1, 2009 at 12:34 PM, Hanen Ben Rhouma wrote:
>  Hello there,
>
> I have another question which is: How can I get the result of a method
> called into my execute() method and which I want to print out on my JSP page
> (I'm using Struts1.3 and want to call usersForm.getUsersList() for example
> and print them out on the browser where User is an object).
>
> Please, I'm still newbie in coding with Struts and having this blocking
> point for so many days now, no one has an idea around my work environment,
> so you're the last and unique chance that's left for me to get an answer or
> even some pieces of ideas to dig into.
>
> Thanks so much in advance,
> Hanen
>

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



Re: Hibernate3+Spring2.5+Struts2

2009-08-20 Thread Nils-Helge Garli Hegvik
On Thu, Aug 20, 2009 at 5:27 PM, Martin Gainty wrote:
>
> agreed..i would also suggest wrap the code in try catch for the 
> NullPointerException
>
> good call wes!
>
> Martin Gainty


Why?

Nils-H

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



Re: Hibernate3+Spring2.5+Struts2

2009-08-19 Thread Nils-Helge Garli Hegvik
java.lang.NullPointerException
   at action.LoginAction.execute(LoginAction.java:31)

Looks like you have a NPE at line 31 in LoginAction. What line is
that? Which references could have been null?

Nils-H

On Wed, Aug 19, 2009 at 1:59 PM, Zied Bejaoui wrote:
> Thanks for your help, I have fixed this problem by removing the admin 
> property from the mapping file, now I am having another error, the login page 
> display then as soon as I enter the login details I receive this exception:
>
> java.lang.NullPointerException
>        at action.LoginAction.execute(LoginAction.java:31)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        at 
> com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)
>        at 
> com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)
>        at 
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)
>        at 
> com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
>        at 
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
>        at 
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>        at 
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>        at 
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>        at 
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>        at 
> com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)
>        at 
> org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
>        at 
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
>        at 
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>        at 
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>        at 
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>        at 
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>        at 
> com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)
>        at 
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>        at 
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>        at 
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>        at 
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>        at 
> com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:167)
>        at 
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
>        at 
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>        at 
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>        at 
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>        at 
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>        at 
> com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)
>        at 
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>        at 
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>        at 
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>        at 
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>        at 
> org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)
>        at 
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>        at 
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>        at 
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>        at 
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultA

Re: Hibernate3+Spring2.5+Struts2

2009-08-19 Thread Nils-Helge Garli Hegvik
>From your stack trace:

SEVERE: Context initialization failed

org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'sessionFactory' defined in ServletContext
resource [/WEB-INF/applicationContext.xml]: Invocation of init method
failed; nested exception is org.hibernate.PropertyNotFoundException:
Could not find a getter for admin in class po.User

I'm guessing that might have something to do with it.

Nils-H

On Wed, Aug 19, 2009 at 12:40 PM, ZiedBejaoui wrote:
> Hi,
>
> I am trying to run an example to integrate struts2 with hibernate and Spring.
>
> When running the example tomcat display en error: 404 resource is not 
> available.
>
> This is my stack trace:
>
> 19-Aug-2009 11:29:06 org.apache.catalina.core.StandardContext start
>
> SEVERE: Error listenerStart
>
> 19-Aug-2009 11:29:06 org.apache.catalina.core.StandardContext start
>
> SEVERE: Context [/WebApplication4] startup failed due to previous errors
>
> 19-Aug-2009 11:30:00 org.apache.catalina.core.StandardContext stop
>
> INFO: Container 
> org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/WebApplication4]
>  has not been started
>
> 19-Aug-2009 11:30:00 org.apache.catalina.core.StandardContext 
> addApplicationListener
>
> INFO: The listener "org.springframework.web.context.ContextLoaderListener" is 
> already configured for this context. The duplicate definition has been 
> ignored.
>
> 19-Aug-2009 11:30:00 org.springframework.web.context.ContextLoader 
> initWebApplicationContext
>
> INFO: Root WebApplicationContext: initialization started
>
> 19-Aug-2009 11:30:00 
> org.springframework.context.support.AbstractApplicationContext prepareRefresh
>
> INFO: Refreshing 
> org.springframework.web.context.support.xmlwebapplicationcont...@1cfad77: 
> display name [Root WebApplicationContext]; startup date [Wed Aug 19 11:30:00 
> BST 2009]; root of context hierarchy
>
> 19-Aug-2009 11:30:01 
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader 
> loadBeanDefinitions
>
> INFO: Loading XML bean definitions from ServletContext resource 
> [/WEB-INF/applicationContext.xml]
>
> 19-Aug-2009 11:30:01 
> org.springframework.context.support.AbstractApplicationContext 
> obtainFreshBeanFactory
>
> INFO: Bean factory for application context 
> [org.springframework.web.context.support.xmlwebapplicationcont...@1cfad77]: 
> org.springframework.beans.factory.support.defaultlistablebeanfact...@1ed2061
>
> 19-Aug-2009 11:30:01 
> org.springframework.beans.factory.support.DefaultListableBeanFactory 
> preInstantiateSingletons
>
> INFO: Pre-instantiating singletons in 
> org.springframework.beans.factory.support.defaultlistablebeanfact...@1ed2061: 
> defining beans 
> [dataSource,sessionFactory,userDao,userService,messageSource,loginAction]; 
> root of factory hierarchy
>
> 19-Aug-2009 11:30:01 
> org.springframework.jdbc.datasource.DriverManagerDataSource setDriverClassName
>
> INFO: Loaded JDBC driver: com.mysql.jdbc.Driver
>
> 19-Aug-2009 11:30:01 org.hibernate.cfg.Environment 
>
> INFO: Hibernate 3.2.5
>
> 19-Aug-2009 11:30:01 org.hibernate.cfg.Environment 
>
> INFO: hibernate.properties not found
>
> 19-Aug-2009 11:30:01 org.hibernate.cfg.Environment buildBytecodeProvider
>
> INFO: Bytecode provider name : cglib
>
> 19-Aug-2009 11:30:01 org.hibernate.cfg.Environment 
>
> INFO: using JDK 1.4 java.sql.Timestamp handling
>
> 19-Aug-2009 11:30:01 org.hibernate.cfg.HbmBinder 
> bindRootPersistentClassCommonValues
>
> INFO: Mapping class: po.User -> user
>
> 19-Aug-2009 11:30:01 
> org.springframework.orm.hibernate3.LocalSessionFactoryBean buildSessionFactory
>
> INFO: Building new Hibernate SessionFactory
>
> 19-Aug-2009 11:30:01 org.hibernate.connection.ConnectionProviderFactory 
> newConnectionProvider
>
> INFO: Initializing connection provider: 
> org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
>
> 19-Aug-2009 11:30:02 org.hibernate.cfg.SettingsFactory buildSettings
>
> INFO: RDBMS: MySQL, version: 5.4.1-beta-community
>
> 19-Aug-2009 11:30:02 org.hibernate.cfg.SettingsFactory buildSettings
>
> INFO: JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.8 
> ( Revision: ${svn.Revision} )
>
> 19-Aug-2009 11:30:02 org.hibernate.dialect.Dialect 
>
> INFO: Using dialect: org.hibernate.dialect.MySQLDialect
>
> 19-Aug-2009 11:30:02 org.hibernate.transaction.TransactionFactoryFactory 
> buildTransactionFactory
>
> INFO: Using default transaction strategy (direct JDBC transactions)
>
> 19-Aug-2009 11:30:02 
> org.hibernate.transaction.TransactionManagerLookupFactory 
> getTransactionManagerLookup
>
> INFO: No TransactionManagerLookup configured (in JTA environment, use of 
> read-write or transactional second-level cache is not recommended)
>
> 19-Aug-2009 11:30:02 org.hibernate.cfg.SettingsFactory buildSettings
>
> INFO: Automatic flush during beforeCompletion(): disabled
>
> 19-Aug-2009 11:30:02 org.hibernate.cfg.SettingsFactory buildSettings
>
> INFO: Automatic session close at

Re: Struts - 2.1.6 - Prepare Interceptor

2009-08-13 Thread Nils-Helge Garli Hegvik
super.prepare()?

Nils-H

On Thu, Aug 13, 2009 at 9:51 AM, Kishan
Paandy wrote:
>
> Hi Folks,
>
> I have a problem as below:
>
> 1)
> public abstract class AbstractBaseAction implements Preparable
> {
>    public void prepare()
>        {
>        populateSomething();
>        }
> }
>
> 2)
> public class MyAction1 extends AbstractBaseAction
> {
>    ………
> }
>
> 3)
> public abstract class MyAction2 extends AbstractBaseAction implements
> Preparable
> {
>    public void prepare()
>        {
>    doSomething();
>        }
> }
>
> 4)
> public class MyAction3 extends MyAction2
> {
>    ………
> }
>
> I have a design as above.
>
> The prepare() in AbstractBaseAction will do some common logic for MyAction1,
> MyAction2 & MyAction3.
> The prepare() in MyAction2 will do some common logic only for MyAction3.
> Only the prepare() in MyAction2 is being called for MyAction3. Since it’s
> being overridden.
> I want both the prepare() in AbstractBaseAction & MyAction2 to be called one
> after the other in the same order for MyAction3.
> How to achieve this?
> Please advice.
> Thank you.
> Regards,
> Kishan.G
> --
> View this message in context: 
> http://www.nabble.com/Struts---2.1.6---Prepare-Interceptor-tp24950462p24950462.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: struts2 portlet bug RenderRequest cannot be obtained in event phase

2009-08-07 Thread Nils-Helge Garli Hegvik
Not with the Struts tags, no. But it's quite possible to use Ajax with portlets.

Nils-H

On Fri, Aug 7, 2009 at 5:47 PM, Scott Nesbitt wrote:
>
> So Ajax actions do not work in Struts portlets?  If not, do you know if there 
> are plans for them to work in the future?
>
> Thanks,
>
> Scott
>
>
>
> ----- Original Message 
> From: Nils-Helge Garli Hegvik 
> To: Struts Users Mailing List 
> Sent: Friday, August 7, 2009 4:41:53 AM
> Subject: Re: struts2 portlet bug RenderRequest cannot be obtained in event  
> phase
>
>>
>> I have also noticed that struts form tag breaks the layout of the page. I am
>> not sure if you have seen this. I will try to find out why (i.e. not
>> standard html or css issue), otherwise i will use html form.
>
> Try using the "simple" theme.
>
> Nils-H
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: struts2 portlet bug RenderRequest cannot be obtained in event phase

2009-08-07 Thread Nils-Helge Garli Hegvik
>
> I have also noticed that struts form tag breaks the layout of the page. I am
> not sure if you have seen this. I will try to find out why (i.e. not
> standard html or css issue), otherwise i will use html form.

Try using the "simple" theme.

Nils-H

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



Re: struts2 portlet bug RenderRequest cannot be obtained in event phase

2009-08-06 Thread Nils-Helge Garli Hegvik
Try something like this:


  
index
  


This of course assumes that you have actually separated the processing
and view logic in these two actions.

You should also take a look at the portlet tutorial:
http://struts.apache.org/2.1.6/docs/struts-2-portlet-tutorial.html

Nils-H


2009/8/6 Leonidas Papadakis :
> Hi Nils-H and thanks for your reply. Much appreciated.
>
> At the moment this is in my struts.xml
>
> 
>          
>           /WEB-INF/jsp/view/index.jsp
>      
>
>      
>           /WEB-INF/jsp/view/edit.jsp
>           /WEB-INF/jsp/view/index.jsp
>      
>
>   
>
> initially the portlet executes the index action and the code runs fine.
> Afterwards even if i call action index from a form or action editcontent i
> get the exception.
>
> How would i change the above configuration ?
>
> Thanks again
>
> Leon
>
> Nils-Helge Garli Hegvik wrote:
>>
>> The portlet execution life cycle is separated in two: The action/event
>> phase, in which state transitions (typically a form submit) occurs,
>> and then the render phase, where the actual output is rendered. The
>> request object that is available in these two phases are not the same.
>> In the action phase, there is no RenderRequest, only an ActionRequest,
>> and opposite in the render phase. So what's happening is that the
>> action is probably invoked in the action phase in the second case. I
>> suggest that you use a redirectAction result from the action that is
>> processing the submit to avoid this from happening.
>>
>> Nils-H
>>
>> 2009/8/6 Leonidas Papadakis :
>>
>>>
>>> Greetings to all ,
>>>
>>> i have setup latest struts 2.1.6 and created a simple portlet for liferay
>>> 5.2.3
>>>
>>> Everything went smoothly until i tried to run the below code :
>>>
>>> RenderRequest req = PortletActionContext.getRenderRequest();
>>>      ThemeDisplay themeDisplay = (ThemeDisplay)
>>> req.getAttribute(WebKeys.THEME_DISPLAY);
>>>      PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
>>>
>>> in a new action that i called from the index view action. This code runs
>>> smoothly on the index view action but in my second action i get the below
>>> exception
>>>
>>> java.lang.IllegalStateException: RenderRequest cannot be obtained in
>>> event
>>> phase
>>> at
>>>
>>> org.apache.struts2.portlet.context.PortletActionContext.getRenderRequest(PortletActionContext.java:66)
>>>
>>> in the first line ( RenderRequest req =
>>> PortletActionContext.getRenderRequest(); )
>>>
>>> I would really appreciate any replies since i am on a tight schedule.
>>>
>>> Regards,
>>>
>>> Leon
>>>
>>> -
>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>>
>
>

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



Re: struts2 portlet bug RenderRequest cannot be obtained in event phase

2009-08-06 Thread Nils-Helge Garli Hegvik
The portlet execution life cycle is separated in two: The action/event
phase, in which state transitions (typically a form submit) occurs,
and then the render phase, where the actual output is rendered. The
request object that is available in these two phases are not the same.
In the action phase, there is no RenderRequest, only an ActionRequest,
and opposite in the render phase. So what's happening is that the
action is probably invoked in the action phase in the second case. I
suggest that you use a redirectAction result from the action that is
processing the submit to avoid this from happening.

Nils-H

2009/8/6 Leonidas Papadakis :
> Greetings to all ,
>
> i have setup latest struts 2.1.6 and created a simple portlet for liferay
> 5.2.3
>
> Everything went smoothly until i tried to run the below code :
>
> RenderRequest req = PortletActionContext.getRenderRequest();
>       ThemeDisplay themeDisplay = (ThemeDisplay)
> req.getAttribute(WebKeys.THEME_DISPLAY);
>       PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
>
> in a new action that i called from the index view action. This code runs
> smoothly on the index view action but in my second action i get the below
> exception
>
> java.lang.IllegalStateException: RenderRequest cannot be obtained in event
> phase
> at
> org.apache.struts2.portlet.context.PortletActionContext.getRenderRequest(PortletActionContext.java:66)
>
> in the first line ( RenderRequest req =
> PortletActionContext.getRenderRequest(); )
>
> I would really appreciate any replies since i am on a tight schedule.
>
> Regards,
>
> Leon
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: Mixing portlet with regular pages

2009-08-04 Thread Nils-Helge Garli Hegvik
>
> probably wise to beg off this particular plugin until all P1 bugs are quashed
>

Very insightful...

> the JSR268 readme and core sample is located at
> https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_JCP-Site/en_US/-/USD/ViewFilteredProducts-SimpleBundleDownload
>

I'm not sure what you're trying to link to, but that only gives "The
product you requested is not available at this time" for me.

> i would strongly suggest implementing your Portlets with JetSpeed 2 released 
> in May 2009
> among the features:
> Secure Access - Security based on standards, ACLsSingle Point of Entry (SSO, 
> Federated) Enterprise Integration -  (EAI, integration points)Personalization 
> - (customizers, skins) Dynamic Web Components - (portlets based on 
> standards-in this case JSR268)
> Scaleable, Component Architecture featuring multi-threading libraries
>
> there are roughly 17 rfcs the JSR-268 support ..get to know them on 
> need-to-know basis
> http://portals.apache.org/jetspeed-2
>

I'd be very surprised if Jetspeed2 implements JSR-268...

Nils-H

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



Re: Mixing portlet with regular pages

2009-08-04 Thread Nils-Helge Garli Hegvik
What do you mean by "accessed from a totally different server"? Are
you referring to WSRP?

There's a bug in the current version that causes some problems when
you mix servlet actions and portlet actions in the same app. The next
version (hopefully 2.1.8) should have this bug fixed.

Nils-H

On Tue, Aug 4, 2009 at 4:05 PM, Scott Nesbitt wrote:
>
>
> I have an existing Struts 2.1.6 configuration that is working fine.  I am 
> interested in adding a new page that contains a single portlet, and also 
> having the portlet be accessed from a totally different server.  Is this 
> possible with the Struts portlet plugin?
>
> I have read the portlet plugin and tutorial pages and am about to dive into 
> this but wanted to make sure it is feasible first.
>
> Any tips or pointers would be appreciated.
>
> Thanks,
>
> Scott
>
>
>
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: HSSFWorkbook - set direction right to left

2009-08-04 Thread Nils-Helge Garli Hegvik
Why don't you try the POI mailing list instead?

http://poi.apache.org/mailinglists.html

Nils-H

On Tue, Aug 4, 2009 at 3:01 PM, Odelya YomTov wrote:
> Hi!
>
> When I export HSSFWorkbook it writes it from left to right
>
> I would like to right it from right to left
>
> How can I do it?
>
> Thanks!
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: struts 2 portlet interceptor issue

2009-08-03 Thread Nils-Helge Garli Hegvik
>                
>                         name="sessionScopeHandler">
>                        /jsp/test/test.jsp
>                

With this configuration, your sessionScopeHandler will be the only
interceptor running for this action. You either need to include the
portletDefaultStack or set up your own stack that also includes the
framework interceptors that does the "introspection" magic.

Nils-H

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



Re: ActionContext.getContext().getSession return null when I test Struts2 action by JUnit.

2009-08-03 Thread Nils-Helge Garli Hegvik
If I have to, then I just do new ActionContext() and
ActionContext.setContext(). But then again, if I did, I would consider
refactoring it into using SessionAware if it was possible, since it's
a lot more test friendly.

Nils-H

On Mon, Aug 3, 2009 at 1:37 PM, Juanjo Cuadrado wrote:
> Uummm... I haven't looked at the source, but I looked the documentation...
> And I could see that the getContext of ActionContext never returns null
>
> http://struts.apache.org/2.1.6/struts2-core/apidocs/com/opensymphony/xwork2/ActionContext.html#getContext()
>
> Well, how have I to do the test now? How have I to create the ActionContext?
> is it a bug?
>
>
> 2009/8/3 Nils-Helge Garli Hegvik 
>
>> Well, if that was a question, then I didn't see it
>>
>> I would certainly prefer implementing SessionAware, if it's an action
>> you're testing. But if you really need to set up the ActionContext you
>> have to create one first and the "activate" it. If you look at the
>> xwork source code for 2.0.5 you can see that the ActionContext is
>> lazily created for you when getContext() is invoked, whereas in 2.1.2,
>> the context is no longer being created if it does not exist.
>>
>> Nils-H
>>
>> On Mon, Aug 3, 2009 at 1:06 PM, Juanjo Cuadrado
>> wrote:
>> > And... what is the problem??? I have the same problem with junit test and
>> > actions. No matter how long ago the comment was written. He might have
>> found
>> > out already, but I not and he not has written the solution here.
>> >
>> > But I wan to say a thing... When you does
>> > "ActionContext.getContext().setSession(param)" with xwork-2.1.2, you get
>> a
>> > NullPointerException, but if you do it with xwork-2.0.5, it works.
>> >
>> > If any know what is happening, I would be extremely grateful.
>> >
>> >
>> > 2009/8/3 Nils-Helge Garli Hegvik 
>> >
>> >> He might have found out already, considering this was posted 1,5 years
>> >> ago...
>> >>
>> >> Nils-H
>> >>
>> >> On Mon, Aug 3, 2009 at 12:44 PM, Juanjo Cuadrado
>> >> wrote:
>> >> > Hi,
>> >> >
>> >> > That is wrong... if you do this, throws a NullPointerException...
>> >> >
>> >> >
>> >> > 2008/2/1 Joey 
>> >> >
>> >> >> I found it . like this.
>> >> >>
>> >> >>        Map param = new HashMap();
>> >> >>        ActionContext.getContext().setSession(param);
>> >> >>
>> >> >> Thanks for your help
>> >> >>
>> >> >> On Feb 1, 2008 4:53 PM, Joey  wrote:
>> >> >> > Thanks,  I just checked testing class in Struts2 package,  but I am
>> a
>> >> >> > newbie for Struts2. I cannot understant Struts2 very well, so if
>> you
>> >> >> > don't mind, pls tell me which testing class I can learn from.
>> >> >> >
>> >> >> > Thanks again
>> >> >> >
>> >> >> >
>> >> >> > On Feb 1, 2008 4:31 PM, Nils-Helge Garli Hegvik 
>> >> >> wrote:
>> >> >> > > You need to initialize the ActionContext in your unit tests. Take
>> a
>> >> >> > > look at the Struts 2 tests how it is solved there.
>> >> >> > >
>> >> >> > > Nils-H
>> >> >> > >
>> >> >> > >
>> >> >> > > On Feb 1, 2008 9:28 AM, Joey Watson 
>> >> >> wrote:
>> >> >> > > > Hi everybody.
>> >> >> > > >
>> >> >> > > > I want to test a action class (Struts2) by JUnit. and then
>> method
>> >> in
>> >> >> > > > this action need a value in session, then when I run my JUnit
>> test
>> >> >> > > > class,  ActionContext.getContext().getSession return null. (not
>> >> >> > > > ActionContext.getContext().getSession().get("XXX") return
>> null).
>> >> >> > > > this action class is working fine in browser.
>> >> >> > > >
>> >> >> > > >
>> >> >> > > > thanks for any help
>> >> >> > > >
>> >> >> > > > Joey
>> >> >> > > >
>&g

Re: ActionContext.getContext().getSession return null when I test Struts2 action by JUnit.

2009-08-03 Thread Nils-Helge Garli Hegvik
Well, if that was a question, then I didn't see it

I would certainly prefer implementing SessionAware, if it's an action
you're testing. But if you really need to set up the ActionContext you
have to create one first and the "activate" it. If you look at the
xwork source code for 2.0.5 you can see that the ActionContext is
lazily created for you when getContext() is invoked, whereas in 2.1.2,
the context is no longer being created if it does not exist.

Nils-H

On Mon, Aug 3, 2009 at 1:06 PM, Juanjo Cuadrado wrote:
> And... what is the problem??? I have the same problem with junit test and
> actions. No matter how long ago the comment was written. He might have found
> out already, but I not and he not has written the solution here.
>
> But I wan to say a thing... When you does
> "ActionContext.getContext().setSession(param)" with xwork-2.1.2, you get a
> NullPointerException, but if you do it with xwork-2.0.5, it works.
>
> If any know what is happening, I would be extremely grateful.
>
>
> 2009/8/3 Nils-Helge Garli Hegvik 
>
>> He might have found out already, considering this was posted 1,5 years
>> ago...
>>
>> Nils-H
>>
>> On Mon, Aug 3, 2009 at 12:44 PM, Juanjo Cuadrado
>> wrote:
>> > Hi,
>> >
>> > That is wrong... if you do this, throws a NullPointerException...
>> >
>> >
>> > 2008/2/1 Joey 
>> >
>> >> I found it . like this.
>> >>
>> >>        Map param = new HashMap();
>> >>        ActionContext.getContext().setSession(param);
>> >>
>> >> Thanks for your help
>> >>
>> >> On Feb 1, 2008 4:53 PM, Joey  wrote:
>> >> > Thanks,  I just checked testing class in Struts2 package,  but I am a
>> >> > newbie for Struts2. I cannot understant Struts2 very well, so if you
>> >> > don't mind, pls tell me which testing class I can learn from.
>> >> >
>> >> > Thanks again
>> >> >
>> >> >
>> >> > On Feb 1, 2008 4:31 PM, Nils-Helge Garli Hegvik 
>> >> wrote:
>> >> > > You need to initialize the ActionContext in your unit tests. Take a
>> >> > > look at the Struts 2 tests how it is solved there.
>> >> > >
>> >> > > Nils-H
>> >> > >
>> >> > >
>> >> > > On Feb 1, 2008 9:28 AM, Joey Watson 
>> >> wrote:
>> >> > > > Hi everybody.
>> >> > > >
>> >> > > > I want to test a action class (Struts2) by JUnit. and then method
>> in
>> >> > > > this action need a value in session, then when I run my JUnit test
>> >> > > > class,  ActionContext.getContext().getSession return null. (not
>> >> > > > ActionContext.getContext().getSession().get("XXX") return null).
>> >> > > > this action class is working fine in browser.
>> >> > > >
>> >> > > >
>> >> > > > thanks for any help
>> >> > > >
>> >> > > > Joey
>> >> > > >
>> >> > > >
>> -
>> >> > > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> >> > > > For additional commands, e-mail: user-h...@struts.apache.org
>> >> > > >
>> >> > > >
>> >> > >
>> >> > >
>> -
>> >> > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> >> > > For additional commands, e-mail: user-h...@struts.apache.org
>> >> > >
>> >> > >
>> >> >
>> >>
>> >> -
>> >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> >> For additional commands, e-mail: user-h...@struts.apache.org
>> >>
>> >>
>> >
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>

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



Re: ActionContext.getContext().getSession return null when I test Struts2 action by JUnit.

2009-08-03 Thread Nils-Helge Garli Hegvik
He might have found out already, considering this was posted 1,5 years ago...

Nils-H

On Mon, Aug 3, 2009 at 12:44 PM, Juanjo Cuadrado wrote:
> Hi,
>
> That is wrong... if you do this, throws a NullPointerException...
>
>
> 2008/2/1 Joey 
>
>> I found it . like this.
>>
>>        Map param = new HashMap();
>>        ActionContext.getContext().setSession(param);
>>
>> Thanks for your help
>>
>> On Feb 1, 2008 4:53 PM, Joey  wrote:
>> > Thanks,  I just checked testing class in Struts2 package,  but I am a
>> > newbie for Struts2. I cannot understant Struts2 very well, so if you
>> > don't mind, pls tell me which testing class I can learn from.
>> >
>> > Thanks again
>> >
>> >
>> > On Feb 1, 2008 4:31 PM, Nils-Helge Garli Hegvik 
>> wrote:
>> > > You need to initialize the ActionContext in your unit tests. Take a
>> > > look at the Struts 2 tests how it is solved there.
>> > >
>> > > Nils-H
>> > >
>> > >
>> > > On Feb 1, 2008 9:28 AM, Joey Watson 
>> wrote:
>> > > > Hi everybody.
>> > > >
>> > > > I want to test a action class (Struts2) by JUnit. and then method in
>> > > > this action need a value in session, then when I run my JUnit test
>> > > > class,  ActionContext.getContext().getSession return null. (not
>> > > > ActionContext.getContext().getSession().get("XXX") return null).
>> > > > this action class is working fine in browser.
>> > > >
>> > > >
>> > > > thanks for any help
>> > > >
>> > > > Joey
>> > > >
>> > > > -
>> > > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> > > > For additional commands, e-mail: user-h...@struts.apache.org
>> > > >
>> > > >
>> > >
>> > > -
>> > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> > > For additional commands, e-mail: user-h...@struts.apache.org
>> > >
>> > >
>> >
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>

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



Re: Struts2 portlet bug found

2009-07-21 Thread Nils-Helge Garli Hegvik
Ah, sorry, I think I misunderstood

As they say in the uPortal forum, this is probably due to the older
version of uPortal returning all session attributes regardless of
scope. When this was fixed, you need to specify the correct scope to
retrieve application scoped attributes, but they are still in the
session. The "application" object is for attributes in the
PortletContext (or ServletContext if it's a servlet). Since the
session is represented as a Map object in Struts 2, there is no
support for "scope" (just simple "get" and "put" operations). To
retrieve the application scoped session attribute, you need to do as I
suggested in the previous reply, get the raw session and access it
directly.

Nils-H

On Wed, Jul 22, 2009 at 8:50 AM, Nils-Helge Garli
Hegvik wrote:
> Does it work if you access the session "raw" (get the session and do
> session.getAttribute("studentId", PortletSession.APPLICATION_SCOPE)?
> Have you tried deploying to a different portlet container such as
> jboss portal or just plain pluto? I assume that the resources you're
> sharing session between are in the same war file? Unless you're
> calling "clear()" on the session map, Struts 2 doesn't do anything to
> the session, so it should not just disappear like that. Considering
> you're using the same Struts 2 version in both deployments, I'm not
> sure what could be wrong...
>
> Nils-H
>
> On Wed, Jul 22, 2009 at 3:48 AM, Tracy12 wrote:
>>
>> Hi,
>>
>> We got a  struts 2.0.6 portlet application with uPortal  2.5.3 ( inside
>> Pluto 1.0.x) with no issues and running fine.
>>
>> Now we deployed the same struts 2.0.6 application in uPortal 3.1.1 (inside
>> pluto 1.1.7) and found following issue.
>>
>> in our action classes we had the following,  where session is of type
>> PortletSession.
>>
>> session.setAttribute("studentId","111",PortletSession.APPLICATION_SCOPE)
>>
>> We trieved the above studentId in the jsp as follows.
>> 
>>
>> The above worked with no issues in uPortal 2.5.3 but with uPortal 3.1.1 this
>> is not working,
>> Then I tried the following
>>  but didnt work,
>>
>>
>> I  interacted with the uPortal forum and this is what it
>> tells...http://www.nabble.com/Re%3A-is-this-a-bug-in-struts2-portlets-td24581733.html
>>
>> I thought based on that  should
>> work,
>>
>> What else could I try, This looks to me a bug. Can't understand why it is
>> not in the value stack.
>>
>> If not pls let me know how to retrieve the above
>> PortletSession.APPLICATION_SCOPE variable in the jsp.
>>
>> If this has been fixed let me know which struts 2 version is that.
>>
>>
>> I did try the following also with no luck
>>
>> 
>>
>> waiting for a quick reply
>>
>>
>> Thanks
>>
>>
>>
>>
>>
>> --
>> View this message in context: 
>> http://www.nabble.com/Struts2-portlet-bug-found-tp24598748p24598748.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>

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



Re: Struts2 portlet bug found

2009-07-21 Thread Nils-Helge Garli Hegvik
Does it work if you access the session "raw" (get the session and do
session.getAttribute("studentId", PortletSession.APPLICATION_SCOPE)?
Have you tried deploying to a different portlet container such as
jboss portal or just plain pluto? I assume that the resources you're
sharing session between are in the same war file? Unless you're
calling "clear()" on the session map, Struts 2 doesn't do anything to
the session, so it should not just disappear like that. Considering
you're using the same Struts 2 version in both deployments, I'm not
sure what could be wrong...

Nils-H

On Wed, Jul 22, 2009 at 3:48 AM, Tracy12 wrote:
>
> Hi,
>
> We got a  struts 2.0.6 portlet application with uPortal  2.5.3 ( inside
> Pluto 1.0.x) with no issues and running fine.
>
> Now we deployed the same struts 2.0.6 application in uPortal 3.1.1 (inside
> pluto 1.1.7) and found following issue.
>
> in our action classes we had the following,  where session is of type
> PortletSession.
>
> session.setAttribute("studentId","111",PortletSession.APPLICATION_SCOPE)
>
> We trieved the above studentId in the jsp as follows.
> 
>
> The above worked with no issues in uPortal 2.5.3 but with uPortal 3.1.1 this
> is not working,
> Then I tried the following
>  but didnt work,
>
>
> I  interacted with the uPortal forum and this is what it
> tells...http://www.nabble.com/Re%3A-is-this-a-bug-in-struts2-portlets-td24581733.html
>
> I thought based on that  should
> work,
>
> What else could I try, This looks to me a bug. Can't understand why it is
> not in the value stack.
>
> If not pls let me know how to retrieve the above
> PortletSession.APPLICATION_SCOPE variable in the jsp.
>
> If this has been fixed let me know which struts 2 version is that.
>
>
> I did try the following also with no luck
>
> 
>
> waiting for a quick reply
>
>
> Thanks
>
>
>
>
>
> --
> View this message in context: 
> http://www.nabble.com/Struts2-portlet-bug-found-tp24598748p24598748.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: Pb displaying image

2009-07-21 Thread Nils-Helge Garli Hegvik
1. You put it in a directory that your webserver serve...
or
2. Create a servlet that reads the data from the filesystem and sends
back the data in the response.

I'd certainly prefer option 1 if possible.

Nils-H

On Tue, Jul 21, 2009 at 9:31 AM, tutu wrote:
>
> Thanks for response.
> Just one question, how do you make the image visible on the webserver
> without putting it in the web application?
>
>
> Jim Kiley wrote:
>>
>> Make sure the image is visible to your webserver, and then use an
>> http://url to access it, rather than a file:// url.
>> jk
>>
>> On Mon, Jul 20, 2009 at 11:08 AM, tutu  wrote:
>>
>>>
>>> Hi,
>>>
>>> I have a pb while trying to display an image that is not in my
>>> application
>>> but on the file system!!
>>>
>>> I've tried to put this in my jsp:
>>>
>>> file:///<%=request.getAttribute( /1.png">
>>>
>>> and that too:
>>> >> src="file:///<%=request.getAttribute("imageLocation")%>/1.png"/>
>>> >> src="file:///<%=request.getAttribute("imageLocation")%>/1.png"/>
>>>
>>> (imageLocation reference D:/images)
>>>
>>> but nothing is displayed. Does anybody knows how to display an image that
>>> is
>>> not in the web application?
>>>
>>> thanks,
>>>
>>> tugdual
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Pb-displaying-image-tp24571593p24571593.html
>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>
>>>
>>
>>
>> --
>> Jim Kiley
>> Senior Technical Consultant | Summa
>> [p] 412.258.3346
>> http://www.summa-tech.com
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Pb-displaying-image-tp24571593p24582908.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: Problem with LoginInterceptor

2009-07-20 Thread Nils-Helge Garli Hegvik
You need to include one of the framework interceptor stacks (e.g
"defaultStack") in your "defaultLoginStack" stack. As you have
configured it, your interceptor is the only one that is being
executed, so none of the framework "magic" gets applied.

Nils-H

On Mon, Jul 20, 2009 at 10:09 AM, mathias-ewald wrote:
>
> Hi,
>
> recently I was told using Interceptors was better than using a BaseAction
> object performing the login process. I agree. Still I have some trouble:
>
> This is what happens: I have a JSP that creates a button liked with another
> action:
>
> AgencyDetails.jsp
> -
> ...
> 
>         />
> 
> Place Rating!
> ...
> -
>
> This is the struts.xml configuration for that Action:
>
> rating.xml
> -
> 
>        
>         class="de.mathiasewald.projektseminar.action.rating.Rate">
>                
>                        /rating/Rate.jsp
>                
>        
> 
> -
>
> This is the inteceptor stack in struts.xml
>
> -
> 
>     class="de.mathiasewald.projektseminar.interceptor.LoginInterceptor">
>
>    
>    
>        
>    
> 
> -
>
> and finally the LoginInterceptor.java
>
> -
> public class LoginInterceptor extends AbstractInterceptor implements
> StrutsStatics {
>
>        /**
>         *
>         */
>        private static final long serialVersionUID = -6647897949084333127L;
>
>
>        private LoginManager loginManager = new LoginManager();
>
>        private static final Log log = 
> LogFactory.getLog(LoginInterceptor.class);
>
>        private static final String USER_HANDLE = 
> "QUADRAN_USER_SESSSION_HANDLE";
>        private static final String LOGIN_ATTEMPT = "QUADRAN_LOGIN_ATTEMPT";
>        private static final String USERNAME = "QUADRAN_USERNAME";
>        private static final String PASSWORD = "QUADRAN_PASSWORD";
>
>
>
>        public void init () {
>                log.info ("Intializing LoginInterceptor");
>        }
>
>        public void destroy () {}
>
>        public String intercept (ActionInvocation invocation) throws Exception 
> {
>                // Get the action context from the invocation so we can access 
> the
>                // HttpServletRequest and HttpSession objects.
>                final ActionContext context = invocation.getInvocationContext 
> ();
>                HttpServletRequest request = (HttpServletRequest)
> context.get(HTTP_REQUEST);
>                HttpSession session =  request.getSession (true);
>
>                // Is there a "user" object stored in the user's HttpSession?
>                Object user = session.getAttribute (USER_HANDLE);
>                if (user == null) {
>                        // The user has not logged in yet.
>
>                        // Is the user attempting to log in right now?
>                        String loginAttempt = request.getParameter 
> (LOGIN_ATTEMPT);
>                        if (loginAttempt != null && 
> loginAttempt.trim().length() > 0) { // The
> user is attempting to log in.
>
>                                log.info("User tries to log in - processing 
> attempt...");
>
>                                // Process the user's login attempt.
>                                if (processLoginAttempt (request, session) ) {
>                                        // The login succeeded send them the 
> login-success page.
>                                        log.info("User " + loginAttempt + " 
> logged in successfully.");
>                                        return invocation.invoke ();
>                                } else {
>                                        // The login failed. Set an error if 
> we can on the action.
>                                        log.info("Error authenticating user " 
> + loginAttempt);
>                                        Object action = invocation.getAction 
> ();
>                                        if (action instanceof 
> com.opensymphony.xwork2.ValidationAware) {
>                                                
> ((com.opensymphony.xwork2.ValidationAware) action).addActionError
> ("Username or password incorrect.");
>                                        }
>                                }
>                        }
>
>                        // Either the login attempt failed or the user hasn't 
> tried to login yet,
>                        // and we need to send the login form.
>                        return "login";
>                } else {
>                        return invocation.invoke ();
>                }
>        }
>
>        /**
>         * Attempt to process the user's login attempt delegating the work to 
> the
>         * SecurityManager.
>         */
>        public boolean processLoginAttempt (HttpServletRequest request, 
> HttpSession
> session) {
>                // Get the username and p

Re: Struts w/Ajax with Struts again

2009-07-19 Thread Nils-Helge Garli Hegvik
The form will not be updated unless you refresh the values or the part
of the page that displays the values you want to be updated. So you
would have to "manually" do this processing some returned updated
values in a json result, or by returning the result of a "partial" jsp
which re-renders the part of the page that you want to be updated, and
then replace the existing html (using innerHTML).

Nils-H

On Sat, Jul 18, 2009 at 3:45 AM, cpanon wrote:
> Hello
> I am able to use an Ajax call to a struts action and with getInputForward() 
> get the get the data back.  (With prototpye and json, very, very elegant).  I 
> am now realizing that I have cases where I want to reprocess all components, 
> i.e. I want the actionForm to be updated and the jsp recalculated, I want the 
> session objects to be reprocessed so my iterate tags will show the updates, 
> etc.  I understand how with getInputForward it doesnt happen.  If I 
> setAttribute(), the original value that was processed when the form first 
> generated is all that ever shows.  A simple findForward() does not force the 
> reprocessing,ie still the original values of the actionsForm members.  Is 
> there a way to force a complete reprocessing the jsp from within an action?  
> tia.
>

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



Re: EJB Injection in Interceptor

2009-07-16 Thread Nils-Helge Garli Hegvik
The short answer - You have to do the lookup yourself.

The long answer - There's a similar discussion going on that pretty
much covers the topic:
http://www.nabble.com/Struts2-Action-Class-and-EJB-Injection-td24497801.html

Nils-H

On Thu, Jul 16, 2009 at 10:03 PM, Nathan Schulte wrote:
> This may be more related to XWork2, but I'll start by asking here.
>
> I'm creating a custom Interceptor to handle user permissions for an 
> application.
>  Rather than redirecting to an action to actually process a login attempt
> (requiring a custom result type), the Interceptor itself will process the 
> login
> attempt.  However, in order for this to work, the Interceptor needs access to 
> a
> session bean that is the interface to the persistence layer.
>
> Is it possible to use the Java EE 5 @EJB annotation to inject an EJB, or even
> the Inject EJB Plugin?  I've tried both, and neither seem to work (both result
> in a null object reference).  I realize I can use a JNDI lookup to get a
> reference to the bean, but I would much rather use injection if possible, as
> that's why it's there.
>
> Thanks!
> -Nate
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: unit testing Struts2 application (with Spring and Hibernate)

2009-07-16 Thread Nils-Helge Garli Hegvik
If it's integration testing you want to do, I've had success embedding
Jetty and doing "full" in-container integration testing. Embedding
Jetty is really easy, and it's pretty fast too. Although not Struts 2
specific, take a look at this article:
http://today.java.net/pub/a/today/2007/04/12/embedded-integration-testing-of-web-applications.html

Nils-H


On Thu, Jul 16, 2009 at 8:27 PM, Dimitrios
Christodoulakis wrote:
> Thanks everyone for their opinions. I was indeed hoping to hear both
> sides of this matter, with both bringing valid arguments and make good
> points.
>
> I was wondering with popular frameworks like struts, spring and
> hibernate integrated together and the increasing adoption of test
> driven, and agile development, there should be at least a couple of
> comprehensive, and well documented strategies on how to perform such
> kind of unit testing with the whole working stack included in the unit
> tests.
>
> I am somewhat curious in trying to do this and making it work, so if
> anyone is aware of any other resources, or strategies in addition to
> Greg's article, where Spring is involved, I'd be very interested in
> taking a look at them.
>
> Or, if someone has done such Struts testing before and wouldn't mind
> sharing some high-level advice, or hints toward a good starting point,
> that would be very helpful and I am sure others can find this
> information of value too.
>
> Again, thank you for your input.
>
>
>
>
>
> On Thu, Jul 16, 2009 at 12:19 PM, Greg Lindholm 
> wrote:
>> Well everyone has an opinion so here mine:
>>
>> I want to unit test my Struts actions in the full Struts context which
>> includes  the interceptor stack and validation. This way I know my actions
>> and results are configured correctly since I test them. I also know my
>> declarative validations are working correctly. I use junit and I really
>> don't want or have time to have to learn another test tool for integration
>> testing.
>>
>> So to do this type of testing I wrote a StrutsTestContext class to run my
>> actions.
>> For full info see:
>> http://glindholm.wordpress.com/2008/06/30/unit-testing-struts-2-actions/
>>
>> I don't use Spring so this class would need to be tweaked for Spring but you
>> are welcome to use this as a starting point.
>>
>> This gives me a lot of flexibility for testing, sometimes I test against an
>> actual database (with hibernate) and sometimes I mock the services that the
>> actions use.
>>
>>
>>
>> On Thu, Jul 16, 2009 at 10:43 AM, Dimitrios Christodoulakis <
>> dimi@gmail.com> wrote:
>>
>>> Hello,
>>>
>>> I was hoping to hear the community's views about unit testing a
>>> Struts2 application which is integrated with Spring and Hibernate. My
>>> plan is to unit test the actions with the framework's interceptors
>>> running, rather than each action class in a stand-alone isolated
>>> fashion.
>>>
>>> What approach do you usually follow? A highly regarded article:
>>>
>>> http://depressedprogrammer.wordpress.com/2007/06/18/unit-testing-struts-2-actions-spring-junit/
>>> provides some useful hints and starting points.
>>>
>>> I would like to use Junit 4 with Ant for this. Are there any other
>>> resources, or documented steps to take as far as you know, or
>>> recommend?
>>>
>>> I found quite a few bits and pieces searching online, but would
>>> appreciate any general guidance or advice on how to begin with this.
>>>
>>> Many thanks and regards.
>>>
>>> -
>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>
>>>
>>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: URL to underlying action

2009-07-16 Thread Nils-Helge Garli Hegvik

Try using the url tag without specifying value or action.

Nils-H

Den 16. juli. 2009 kl. 13.14 skrev mathias-ewald :



Hi,

is there a way to create a URL (like ) to the Action that  
called a

JSP file? I would like to reuse some code like forms and other stuff

cu
mathias
--
View this message in context: 
http://www.nabble.com/URL-to-underlying-action-tp24514500p24514500.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



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



Re: Struts2, JQuery and JSON result to create a dynamic ajax website

2009-07-13 Thread Nils-Helge Garli Hegvik
Did you look at the "Excluding properties" example in the json plugin
documentation?

Nils-H

On Mon, Jul 13, 2009 at 9:15 AM, GF wrote:
> You're absolutely right,
> but there is a "security reason", in real-world application, the
> objects i get from business service, are usually JPA entities, and
> putting a "full JPA entity" on the json result will lead to issues in
> the case there are some properties of that object that have to kept
> "hidden" to the end users.. (i.e. in the case of a "User" entity,
> would a not good idea to return in the json result its hashed
> password).
>
> Your suggestion would surely lead to a "clean code" but an
> unexperienced programmer might show to its website user some
> information he didn't want to...
>
>
>
>
>> A quick look at your tutorial makes me think you are underestimating the
>> capability of the JSON plugin. It is fully capable of serializing most java
>> objects to JSON. Rather than explicitly creating a hashmap, why not put the
>> 'item' on the action and then set a json result with item configured as the
>> root object.
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: [OT] Return Hashmap java object from servlet

2009-07-07 Thread Nils-Helge Garli Hegvik
What exactly are you trying to do? Do you want to serialize the
hashmap to the client as a Java object, or do you want it converted to
xml? What does the consuming end expect? If you really want to produce
xml, take a look at one of the many java <-> xml libraries that exists
(although, something as simple as your example, you could probably
construct the xml "by hand"). A google search should give you more
than enough information.

Nils-H

On Tue, Jul 7, 2009 at 6:06 PM, Ashish
Kulkarni wrote:
> HiIs it possible to return Hashmap object from java Servlet,  What kind of
> ContentType can i set to the response?
>
> The other option is to set data from HashMap into XML and return it as XML
> file.
>
> for example.
>
> I have servlet like below
>
> public class ReturnObjectServlet extends HttpServlet
> {
> public void doGet(HttpServletRequest request, HttpServletResponse response)
> throws ServletException, IOException
> {
>
> processResponse(request, response);
> }
>
> public void doPost(HttpServletRequest request, HttpServletResponse response)
> throws ServletException, IOException
> {
>
> processResponse(request, response);
> }
>
> private void processResponse(HttpServletRequest request,
> HttpServletResponse response) throws ServletException, IOException
> {
>
>           Map map1 = new HashMap();
>   map1.put("ABC", "XYZ");
>   map1.put("ABC2", "XYZ");
>   map1.put("ABC3", "XYZ");
>
>        // What kind of response type can i set??
>         response.setContentType("text/xml; charset=UTF-8");
>         PrintWriter out = response.getWriter();
>         out.print(map1);
>         out.close();
>
>        }
>
>
> }
>

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



Re: Struts 1.2 in Tomact 5.0 giving ERRORS...

2009-07-03 Thread Nils-Helge Garli Hegvik
Change the classpath to servlet-api? Where? The container should
provide all the jsp and servlet jars that you need (with correct
versions). You should probably not tamper with the classpath to any of
those...

Nils-H

On Fri, Jul 3, 2009 at 10:40 AM, pasanewa wrote:
>
> I was using Tomcat 4.1 and Struts..I was doing fine. Until i tried to use EL.
> But EL can only be used in Tomcat 5.0. So i installed Tomcat 5.0 and
> uninstalled Tomcat 4.0.
> But then there came lots of ERRORS.
>
> I changed the CLASSPATH to servlet-api.jar(new version)
>
> BUT there still are errors. I think JSP 2.0 isnt being able to read the
> TAGLIBS..
> so it shows errors..
>
> ERROR [http-8080-Processor25] (StandardWrapperValve.java:250) -
> Servlet.service() of servlet jsp threw out the exception.
> java.lang.NoSuchMethodError:
> javax.servlet.jsp.tagext.TagAttributeInfo.(Ljava/lang/String;ZLjava/lang/String;ZZ)V
>        at
> org.apache.jasper.compiler.TagLibraryInfoImpl.createAttribute(TagLibraryInfoImpl.java:581)
>        at
> org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoImpl.java:402)
>        at
> org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:249)
>        at
> org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:180)
>        at 
> org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:424)
>        at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:493)
>        at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1557)
>        at org.apache.jasper.compiler.Parser.parse(Parser.java:127)
>        at
> org.apache.jasper.compiler.ParserController.doParse(ParserController.java:212)
>        at
> org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
>        at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:156)
>        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:296)
>        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
>        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
>        at
> org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
>        at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:299)
>        at 
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
>        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>        at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
>        at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
>        at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
>        at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
>        at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>        at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
>        at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
>        at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
>        at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
>        at
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
>        at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
>        at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
>        at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
>        at java.lang.Thread.run(Thread.java:619)
>
>
> 
>
> My index.jsp page has...
>
> <%@ page language="java"%>
> <%@ taglib uri="http://struts.apache.org/tags-logic"; prefix="logic" %>
> 
>
>
>
> THIS IS it...
>
>
> CAN ANYONE HELP me with this???
> plzz
> --
> View this message in context: 
> http://www.nabble.com/Struts-1.2-in-Tomact-5.0-giving-ERRORS...-tp24319651p24319651.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: Error when deploying portlets beside a normal Struts2 web app?

2009-06-26 Thread Nils-Helge Garli Hegvik
It should be fixed now in trunk. Let me now if it works or not.

Nils-H

On Wed, Jun 24, 2009 at 6:01 PM, phillips1021 wrote:
>
> I added to the Jira bug report another example application that demonstrates
> the problem.  The example application is a simple Struts 2 (using 2.1.6)
> application that has both normal actions and Portlet actions.
>
> You can also download this example application (an archive of an Eclipse
> Dynamic Web Project that uses Maven) at
> http://www.brucephillips.name/struts/StrutsExample.zip.
>
> Unzip the example application and the open a command window.  Navigate to
> where you unzipped the application.
>
> Run "mvn clean" at the command prompt
>
> Run "mvn jetty:run" at the command prompt
>
> When you see the message [INFO] Started Jetty Server open your web browser
> and navigate to
>
> http://localhost:8080/StrutsExample/index.jsp
>
> Click on link for normal Struts 2 action and you should see "Hello from
> Struts 2"
>
> Click on link for Hello from portlet action and you should see "Hello from
> Struts 2"
>
> Click on link for Run Run a normal Struts 2 action that loads a JSP with a
> search form built using s:form tag and you'll get the exception discussed
> earlier.
>
> Type control C in the command prompt window to stop Jetty server
>
> Edit the pom.xml file:
>   Change the Struts 2 to version 2.0.11
>   Comment out the dependency on struts2-portlet-plugin
>
> Save the pom.xml file
>
> In command window run "mvn clean" and then "mvn jetty:run"
>
> When you see the message [INFO] Started Jetty Server open your web browser
> and navigate to
>
> http://localhost:8080/StrutsExample/index.jsp
>
> Click on link for normal Struts 2 action and you should see "Hello from
> Struts 2"
>
> Click on link for Hello from portlet action and you should see "Hello from
> Struts 2"
>
> Click on link for Run Run a normal Struts 2 action that loads a JSP with a
> search form built using s:form tag and you'll see the simple search form
> built using the s:form tag
>
> Click on the link Click here to start the search form example as a portlet
> and you'll also see the simple search form
>
> It seems that the s:form tag is causing a problem when using the
> struts2-portlet-plugin version 2.1.6 with struts 2 core version 2.1.6.
>
> We hope this is fixed in the upcoming release of version 2.1.7 as we would
> like to use the current release of Struts 2 to build web applications that
> can be used as standalone applications and as portlet within a portlet
> container.
>
>
>
> --
> View this message in context: 
> http://www.nabble.com/Error-when-deploying-portlets-beside-a-normal-Struts2-web-app--tp23981728p24187641.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: Pre setAttribute for a form

2009-06-26 Thread Nils-Helge Garli Hegvik
Don't have any more ideas, but generally, the message "cannot find
bean in any scope" means exactly what it says: The bean is not in a
scope where it can be found. Which means that either it is set in
request scope, and attempted to be used in a different request
(typically what happens when you do a redirect), or that it has not
been set at all. Also, keep in mind that the request/response cycle is
a little bit different in a portlet than in a regular web application,
so you might have to re-think what you're trying to do.

Nils-H

On Thu, Jun 25, 2009 at 10:05 AM, Sam Wun wrote:
> Like I have said before, if I "manually" navigated to the
> RedirectHellpForm page , then reload the first page (RedirectForm),
> and press the Submit button from the RedirectForm, it can find the
> "name" of RedirectHelpForm.
> My questions is how can I setAttribute("RedirectHelpForm" ...) before
> navigated to the RedirectHelpForm page??
>
> thanks
> Sam
>
> On Thu, Jun 25, 2009 at 5:17 PM, Sam Wun wrote:
>> I just tried your suggestion,
>> it doesn't work.
>> The page flow is:
>> RedirectAction -> RedirectHelpAction -> RedirectStep3Action
>>
>> Here is the RedirectAction.java file:
>>
>> import org.apache.commons.logging.LogFactory;
>>
>> import javax.portlet.ActionRequest;
>> import javax.portlet.ActionResponse;
>> import javax.portlet.PortletConfig;
>> import javax.portlet.RenderRequest;
>> import javax.portlet.RenderResponse;
>>
>> import org.apache.struts.action.ActionForm;
>> import org.apache.struts.action.ActionForward;
>> import org.apache.struts.action.ActionMapping;
>>
>> /** @struts.action name="RedirectForm" path="/struts_redirect_portlet/input"
>>  * attribute="redirectForm"
>>  * scope="session"
>>  * input="/portlet/struts_redirect_portlet/input.jsp"
>>  *
>>  * @struts.action-forward name="input"
>> path="/portlet/struts_redirect_portlet/input.jsp" redirect="false"
>>  * @struts.action-forward name="help"
>> path="/portlet/struts_redirect_portlet/help.jsp" redirect="false"
>>  */
>> public class RedirectAction extends PortletAction {
>>
>>        public ActionForward execute(
>>                        ActionMapping mapping, ActionForm form,
>> HttpServletRequest req,
>>                        HttpServletResponse res)
>>                throws Exception {
>>
>>                RedirectForm redirectForm = (RedirectForm) form;
>>
>>                String comment = redirectForm.getComment().trim();
>>               if ( comment.length() > 0) {
>>                  return mapping.findForward("help");
>>                }
>>
>>                  return mapping.findForward("input");
>>
>>        }
>>
>>
>>        public ActionForward render(
>>                        ActionMapping mapping, ActionForm form,
>> PortletConfig config,
>>                        RenderRequest req, RenderResponse res)
>>                throws Exception {
>>
>>                return mapping.findForward("input");
>>        }
>> }
>>
>> Here is the RedirectHelpAction.java file:
>>
>> import javax.servlet.http.HttpServletResponse;
>>
>> import javax.portlet.ActionRequest;
>> import javax.portlet.ActionResponse;
>> import javax.portlet.PortletConfig;
>> import javax.portlet.RenderRequest;
>> import javax.portlet.RenderResponse;
>>
>> import org.apache.struts.action.ActionForm;
>> import org.apache.struts.action.ActionForward;
>> import org.apache.struts.action.ActionMapping;
>>
>>  /***
>>  * @struts.action name="RedirectHelpForm" 
>> path="/struts_redirect_portlet/help"
>>  * attribute="redirectHelpForm"
>>  * scope="session"
>>  * input="/portlet/struts_redirect_portlet/help.jsp"
>>  * @struts.action-forward name="help"
>> path="/portlet/struts_redirect_portlet/help.jsp" redirect="false"
>>  * @struts.action-forward name="step3"
>> path="/portlet/struts_redirect_portlet/step3.jsp" redirect="false"
>>  */
>>
>> public class RedirectHelpAction extends PortletAction {
>>
>>        public ActionForward execute(
>>                        ActionMapping mapping, ActionForm form,
>> HttpServletRequest req,
>>                        HttpServletResponse res)
>&

Re: Pre setAttribute for a form

2009-06-24 Thread Nils-Helge Garli Hegvik
Did you try request.getSession().setAttribute("RedirectHelpForm",
redirectHelpForm)?

Nils-H

On Thu, Jun 25, 2009 at 7:14 AM, Sam Wun wrote:
> How to do that with session?
> I am currently setting it in the execute() and render method with the
> following code:
> req.setAttribute("RedirectHelpForm",  redirectHelpForm);
>
> but this is for request rather than session?
>
> Thanks for the suggesion.
> sam
>
> On Thu, Jun 25, 2009 at 3:09 PM, Nils-Helge Garli
> Hegvik wrote:
>> Haven't looked very deeply into it, but could it be that you're
>> setting the attribute in the action phase, and trying to access it in
>> the render phase? That won't work. In that case, you have to set it as
>> a session attribute, or set some kind of id as a render parameter and
>> re-fetch the object in the render phase.
>>
>> Nils-H
>>
>> On Thu, Jun 25, 2009 at 7:03 AM, Sam Wun wrote:
>>> Hi,
>>>
>>> I noticed the setAttribute() method is called too late in one of my
>>> Action class:
>>>
>>> import javax.portlet.PortletConfig;
>>> import javax.portlet.RenderRequest;
>>> import javax.portlet.RenderResponse;
>>>
>>> import org.apache.struts.action.ActionForm;
>>> import org.apache.struts.action.ActionForward;
>>> import org.apache.struts.action.ActionMapping;
>>>
>>>  /***
>>>  * @struts.action name="RedirectHelpForm" 
>>> path="/struts_redirect_portlet/help"
>>>  * attribute="redirectHelpForm"
>>>  * scope="session"
>>>  * input="/portlet/struts_redirect_portlet/help.jsp"
>>>  * @struts.action-forward name="help"
>>> path="/portlet/struts_redirect_portlet/help.jsp" redirect="false"
>>>  * @struts.action-forward name="step3"
>>> path="/portlet/struts_redirect_portlet/step3.jsp" redirect="false"
>>>  */
>>>
>>> public class RedirectHelpAction extends PortletAction {
>>>
>>>        public ActionForward execute(
>>>                        ActionMapping mapping, ActionForm form,
>>> HttpServletRequest req,
>>>                        HttpServletResponse res)
>>>                throws Exception {
>>>                RedirectHelpForm redirectHelpForm = (RedirectHelpForm) form;
>>>                req.setAttribute("RedirectHelpForm",  redirectHelpForm);
>>>
>>>                String name = redirectHelpForm.getName().trim();
>>>               if ( name.length() > 0) {
>>>                  return mapping.findForward("step3");
>>>                }
>>>
>>>               return mapping.findForward("help");
>>>        }
>>>
>>>
>>>        public ActionForward render(
>>>                        ActionMapping mapping, ActionForm form,
>>> PortletConfig config,
>>>                        RenderRequest req, RenderResponse res)
>>>                throws Exception {
>>>                RedirectHelpForm redirectHelpForm = (RedirectHelpForm) form;
>>>                req.setAttribute("redirectHelpForm",  redirectHelpForm);
>>>
>>>                return mapping.findForward("help");
>>>        }
>>> }
>>>
>>> The  consequence of that is resulting a "cannot find bean in any scope".
>>>
>>> Actully when the page is died on this reason, I press the back button
>>> of the browser go back to the previous page, and then pressed the
>>> Submit button again, the error would go disappear, because the
>>> RedirectHelpForm bean is alerady populated in the class
>>> RedirectHelpAction, however not in the class RedirectAction.
>>> The code of RedirectAction is shown as below:
>>>
>>> /** @struts.action name="RedirectForm" path="/struts_redirect_portlet/input"
>>>  * attribute="redirectForm"
>>>  * scope="session"
>>>  * input="/portlet/struts_redirect_portlet/input.jsp"
>>>  *
>>>  * @struts.action-forward name="input"
>>> path="/portlet/struts_redirect_portlet/input.jsp" redirect="false"
>>>  * @struts.action-forward name="help"
>>> path="/portlet/struts_redirect_portlet/help.jsp" redirect="false"
>>>  */
>>> public class RedirectAction extends PortletAction {
>>>
>>>        pu

Re: Pre setAttribute for a form

2009-06-24 Thread Nils-Helge Garli Hegvik
Haven't looked very deeply into it, but could it be that you're
setting the attribute in the action phase, and trying to access it in
the render phase? That won't work. In that case, you have to set it as
a session attribute, or set some kind of id as a render parameter and
re-fetch the object in the render phase.

Nils-H

On Thu, Jun 25, 2009 at 7:03 AM, Sam Wun wrote:
> Hi,
>
> I noticed the setAttribute() method is called too late in one of my
> Action class:
>
> import javax.portlet.PortletConfig;
> import javax.portlet.RenderRequest;
> import javax.portlet.RenderResponse;
>
> import org.apache.struts.action.ActionForm;
> import org.apache.struts.action.ActionForward;
> import org.apache.struts.action.ActionMapping;
>
>  /***
>  * @struts.action name="RedirectHelpForm" path="/struts_redirect_portlet/help"
>  * attribute="redirectHelpForm"
>  * scope="session"
>  * input="/portlet/struts_redirect_portlet/help.jsp"
>  * @struts.action-forward name="help"
> path="/portlet/struts_redirect_portlet/help.jsp" redirect="false"
>  * @struts.action-forward name="step3"
> path="/portlet/struts_redirect_portlet/step3.jsp" redirect="false"
>  */
>
> public class RedirectHelpAction extends PortletAction {
>
>        public ActionForward execute(
>                        ActionMapping mapping, ActionForm form,
> HttpServletRequest req,
>                        HttpServletResponse res)
>                throws Exception {
>                RedirectHelpForm redirectHelpForm = (RedirectHelpForm) form;
>                req.setAttribute("RedirectHelpForm",  redirectHelpForm);
>
>                String name = redirectHelpForm.getName().trim();
>               if ( name.length() > 0) {
>                  return mapping.findForward("step3");
>                }
>
>               return mapping.findForward("help");
>        }
>
>
>        public ActionForward render(
>                        ActionMapping mapping, ActionForm form,
> PortletConfig config,
>                        RenderRequest req, RenderResponse res)
>                throws Exception {
>                RedirectHelpForm redirectHelpForm = (RedirectHelpForm) form;
>                req.setAttribute("redirectHelpForm",  redirectHelpForm);
>
>                return mapping.findForward("help");
>        }
> }
>
> The  consequence of that is resulting a "cannot find bean in any scope".
>
> Actully when the page is died on this reason, I press the back button
> of the browser go back to the previous page, and then pressed the
> Submit button again, the error would go disappear, because the
> RedirectHelpForm bean is alerady populated in the class
> RedirectHelpAction, however not in the class RedirectAction.
> The code of RedirectAction is shown as below:
>
> /** @struts.action name="RedirectForm" path="/struts_redirect_portlet/input"
>  * attribute="redirectForm"
>  * scope="session"
>  * input="/portlet/struts_redirect_portlet/input.jsp"
>  *
>  * @struts.action-forward name="input"
> path="/portlet/struts_redirect_portlet/input.jsp" redirect="false"
>  * @struts.action-forward name="help"
> path="/portlet/struts_redirect_portlet/help.jsp" redirect="false"
>  */
> public class RedirectAction extends PortletAction {
>
>        public ActionForward execute(
>                        ActionMapping mapping, ActionForm form,
> HttpServletRequest req,
>                        HttpServletResponse res)
>                throws Exception {
>
>                RedirectForm redirectForm = (RedirectForm) form;
> //              req.setAttribute("redirectForm",  redirectForm);
>
>                String comment = redirectForm.getComment().trim();
>               if ( comment.length() > 0) {
>                  return mapping.findForward("help");
>                }
>
>                  return mapping.findForward("input");
>
>        }
>
>
>        public ActionForward render(
>                        ActionMapping mapping, ActionForm form,
> PortletConfig config,
>                        RenderRequest req, RenderResponse res)
>                throws Exception {
>
>                return mapping.findForward("input");
>        }
> }
>
> Can anyone tell me how to pre-setAttribute for an upcoming Form in an
> Action class?
> It sounds weried. but I couldn't find a way to get rid of the error.
>
> Thanks
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: download link for struts UI Tags?

2009-06-22 Thread Nils-Helge Garli Hegvik
The Struts 2 core already includes the tag libraries. So if you have
downloaded struts 2, then you also have the tag libraries you need.
Struts distributions can be downloaded here:
http://struts.apache.org/downloads.html

Nils-H

On Mon, Jun 22, 2009 at 10:46 AM, Sam Wun wrote:
> Hi,
>
> Can anyone tell me where can I downnload struts (2) UI Tags  library?
>
> Thanks
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: Error when deploying portlets beside a normal Struts2 web app?

2009-06-19 Thread Nils-Helge Garli Hegvik
It would be helpful if you could create a sample app and attach it to
a JIRA issue. Then I'll have a look at it.

Nils-H

On Fri, Jun 19, 2009 at 9:52 PM, phillips1021 wrote:
>
> Nils-H (or anyone else):
>
> I've duplicated this problem with 2.1.6 and portlets as follows:
>
> Created a Struts 2 web/portlet application with a pom.xml having a
> dependency on struts2-core-2.0.11.2.jar.  Works both as a normal web
> application and as a portlet application.
>
> Changed the dependencies to be struts2-core-2.1.6.jar and
> struts2-portlet-plugin-2.1.6.jar.  Running the application as a web
> application in Tomcat 6 results in a org.apache.jasper.JasperException:
> java.lang.NullPointerException whenever a Struts 2 action is called.
>
> Removed the dependency on struts2-portlet-plugin-2.1.6.jar and the
> application runs fine as a normal Struts 2 web application.
>
> I can provide the code that demonstrates the problem if it would be helpful.
>
> Is anyone on the Struts 2 development team researching the cause of this
> problem and a potential fix?
>
> Any insight into if this is an actual bug in 2.1.6 that will be fixed in a
> future release would be helpful.
>
> BTW the maven archtype specified here:
>
>    http://struts.apache.org/2.1.6/docs/struts-2-portlet-tutorial.html
>
> for the portlet tutorial doesn't work.
>
> Thanks for taking a look at this issue.  We had hope to develop Struts 2
> applications that can work as both a standalone web application and as a
> portlet in a portal container.
>
> Bruce
>
>
> If you're using portlets, your package must extend
> "struts-portlet-default" instead of "struts-default". It should be
> possible to run servlet actions and portlet actions in the same
> application.
>
> Nils-H
>
>
>
> --
> View this message in context: 
> http://www.nabble.com/Error-when-deploying-portlets-beside-a-normal-Struts2-web-app--tp23981728p24117787.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: how to correctly generate "path" and "type" in structs-config.xml file?

2009-06-19 Thread Nils-Helge Garli Hegvik
This has nothing to do with Struts. You have to put the source file in
a folder structure that mirrors your package definition.

Nils-H

On Fri, Jun 19, 2009 at 6:00 AM, Sam Wun wrote:
> Hi,
>
> I  have an Action java source code with package at the top of the
> file. When I put the package line in the file, ant couldn't generate
> any content in all *.xml files.
> If I remove the package line from the java source code, all xml files
> are generated, but without path (that come after the word of
> "package").
>
> Please see below for the source code without include the line of
> "package..." in source file:
>
>  # cat ./docroot/WEB-INF/src/OrderAction.java
> //package com.ip6network.onlinepayment.struts.action;
>
> import java.io.IOException;
>
> import org.apache.struts.action.Action;
> import org.apache.struts.action.ActionForward;
> import org.apache.struts.action.ActionMapping;
> import org.apache.struts.action.ActionForm;
>
> import javax.servlet.ServletException;
> import javax.servlet.http.HttpServletRequest;
> import javax.servlet.http.HttpServletResponse;
>
>
> /** @struts.action name="orderForm" path="/orderUser"
>  * scope="request"
>  * validate="false" parameter="action" input="mainMenu"
>  *
>  * @struts.action-forward name="success" path="/next.jsp"
>  */
>
> public class OrderAction extends Action{
>
>   public ActionForward execute(ActionMapping mapping,ActionForm
> form, HttpServletRequest request, HttpServletResponse response) throws
> IOException,ServletException{
>       return mapping.findForward("success");
>   }
> }
>
>  # cat build.xml
> 
>
> 
>       
>
>       
>
>               
>               
>               
>                        location="${app.server.classes.portal.dir}" />
>                        includes="*.jar" />
>                       
>
>                       
>                       
>                       
>               
>
>                                      classname="xdoclet.modules.web.WebDocletTask"
>                       classpathref="plugin.classpath">
>               
>                mergedir="metadata/web" excludedtags="@version,@author"
> verbose="true">
>                       
>                               
>                               
>                               
>                       
>                                                      servletspec="2.3" sessiontimeout="60"
>                               destdir="WEB-INF" distributable="false">
>                       
>                       
>                       
>               
>
>                                      classpathref="plugin.classpath"
>                       compiler="${javac.compiler}"
>                       debug="${javac.debug}"
>                       deprecation="${javac.deprecation}"
>                       destdir="docroot/WEB-INF/classes"
>                       nowarn="${javac.nowarn}"
>                       srcdir="docroot/WEB-INF/src"
>
>               />
>
>               
>       
>
>       
>               
>                        value="docroot/WEB-INF/src/content/test" />
>                       
>               
>       
> 
>
> # pwd
> /usr/liferay-portal-5.2.3/dev/portlets/online-payment/docroot/WEB-INF
> twp1:WEB-INF # cat struts-config.xml
> 
>
>  Struts Configuration 1.1//EN"
> "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd";>
>
> 
>
>  
>  
>
>  
>  
>
>        name="OrderForm"
>     type="OrderForm"
>   />
>
>   
>  
>
>  
>  
>
>  
>  
>
>  
>  
>        path="/orderUser"
>     type="OrderAction"
>     name="orderForm"
>     scope="request"
>     input="mainMenu"
>     parameter="action"
>     unknown="false"
>     validate="false"
>   >
>            name="success"
>       path="/next.jsp"
>       redirect="false"
>     />
>   
>
>   
>  
>
>  
>
>  
>
>  
>
> 
>
>  # cat validation.xml
> 
>  Commons Validator Rules Configuration 1.1//EN"
> "http://jakarta.apache.org/commons/dtds/validator_1_1.dtd";>
>
> 
>  
>  
>  
>
>     
>                                 depends="required">
>                                    name="required"
>                   key="query.required"/>
>
>                 
>             
>     
>  
> 
>
>
> When the line "package..." is written at the top of my java source
> code, all xml config files are only written with xdoclet default
> values, without the value of struts tags from the java source files.
>
> My expected result in the xml files for example:
>
> # cat struts-config.xml
> 
>  Struts Configuration 1.2//EN"
> "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd";>
>
> 
>       
>                type="com.ip6network.onlinepayment.struts.action.OrderForm">
>       
>       
>                type="com.ip6network.onlinepayment.struts.action.OrderAction"
> name="OrderForm" scope="session" validate="true"
> input="/portlet/order_portlet/input.jsp">
>                        path="/portlet/order_portlet/input.jsp">
>                        path="/portlet/order_portlet/help.js

Re: download file

2009-06-17 Thread Nils-Helge Garli Hegvik
Take a look at Pawel and Dave's replies once again.

Nils-H

On Wed, Jun 17, 2009 at 8:55 AM, PEGASUS84 wrote:
>
> thanks,
> now there is a problem in struts.xml:
> Can not find a java.io.InputStream with the name [${contentType}] in the
> invocation stack. Check the
>
>
> --
> View this message in context: 
> http://www.nabble.com/download-file-tp24050039p24067967.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: download file

2009-06-16 Thread Nils-Helge Garli Hegvik
And where does your input stream come from?

On Tue, Jun 16, 2009 at 12:11 PM, PEGASUS84 wrote:
>
> my action  is this:
> public class FileDownload extends ActionSupport {
>
>       InputStream inputStream;
>
>
>   public void setInputStream(InputStream s){inputStream=s;}
>   public InputStream getInputStream(){return inputStream;}
>
>   public String execute(){
>   return "sendFile";
>   }
> }
> and in Struts.xml i've this:
>
> 
>               
>               ${contentType}
>               
>       
>
> i wish to download a file
> --
> View this message in context: 
> http://www.nabble.com/download-file-tp24050039p24051377.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: download file

2009-06-16 Thread Nils-Helge Garli Hegvik
You can't expect someone else to write your code for you...

What have you tried? What errors did you get? You have to at least
provide some informatino for us to help you.

Nils-H

On Tue, Jun 16, 2009 at 11:54 AM, PEGASUS84 wrote:
>
> sorry,
> i don't succeed
> i haven't idea
> --
> View this message in context: 
> http://www.nabble.com/download-file-tp24050039p24051122.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: white space

2009-06-15 Thread Nils-Helge Garli Hegvik
I'd consider creating a new getter that returns what you want.

Nils-H

On Mon, Jun 15, 2009 at 12:01 PM, PEGASUS84 wrote:
>
> good moornig,
>
> my problem is this:
>  i've this select
>
>  listValue="getNome()+getCognome()" theme="simple"
> list="getDocentiNONComm()">
>
> in listValue i Want to separate getNome() and getCognome() with a white
> space.
>
> How can I make it?
> --
> View this message in context: 
> http://www.nabble.com/white-space-tp24031922p24031922.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: [OT]Moving from Struts2 to grails, your thoughts

2009-06-12 Thread Nils-Helge Garli Hegvik
An impressive number of hacks there...

Nils-H

On Fri, Jun 12, 2009 at 1:48 PM, Martin Gainty wrote:
>
> Scott-
> i think what Pawel is suggesting is there is a 'demonstrable' need for a 
> Struts Grails plugin
>
> I have some grails code here so i might decide to tackle this myself..altho i 
> think
> musachy started this ..i dont know how far along he was able to get
>
> BTW my last go around developing the last struts plugin pom.xml revealed some 
> some funky behaviour in com.google.gwt.util.tools.Utility
>
> package com.google.gwt.util.tools;
> public final class Utility {
>  private static void computeInstallationPath()
>  {
>    try
>    {
>        String override = System.getProperty("gwt.devjar");
> //      if (override == null)
> //      {
>        System.out.println("override is null");
>
> //Hack!
>        if(override == null) override = new 
> String("jar:file://F:/GWT/gwt-windows-1.4.60/gwt-dev-windows.jar"); 
> ///!com/google/gwt/util/tools/Utility.class");
>        System.out.println("override = "+override);
>
>        String partialPath = Utility.class.getName().replace('.', '/').concat(
>          ".class");
>
> //Hack!
>        partialPath = new String("jar:file://F:/GWT/GWT-WI~1.60/gwt.jar"); 
> ///!com/google/gwt/util/tools/Utility.class");
>
>        System.out.println("partialpath = "+partialPath);
>        //URL url = new URL(partialPath); 
> //Utility.class.getClassLoader().getResource(partialPath);
>        //System.out.println("url = "+url.getContent().toString());
>        //url = new 
> URL("jar://F:/mygwt/my-gwt-read-only/com/google/gwt/util/tools/Utility.class");
>
> //URL always came back null so this branch never launched
>
>        //if (url != null && "jar".equals(url.getProtocol()))
>        //{
>          System.out.println("url != null path taken");
>
> //Hack!
>          String path=new String("file:/F:/GWT/GWT-WI~1.60"); //null; // = 
> url.toString();
>          System.out.println("path = "+path);
>          String jarPath = path.substring(path.indexOf("file:"));
>          System.out.print("jarPath = "+jarPath);
>
> //Hack!
> //          File devJarFile = new File(URI.create(jarPath));
>          java.io.File devJarFile = new File("F:/GWT/GWT-WI~1.60/gwt.jar");
>          System.out.println("devJarFile = "+devJarFile);
>          if (!devJarFile.isFile())
>          {
>            System.out.println("Could not find jar file; "
>              + devJarFile.getCanonicalPath()
>              + " does not appear to be a valid file");
>          }
>          sDevJarName = devJarFile.getName();
>          System.out.println("sDevJarName = "+sDevJarName);
>
>          String dirPath = jarPath.substring(0, jarPath.lastIndexOf('/') + 1);
>          System.out.println("dirPath = "+dirPath);
>
> //Hack!
> //          File installDirFile = new File(URI.create(dirPath));
>          File installDirFile = new File("F:/GWT/GWT-WI~1.60");
>          System.out.println("installDirFile = "+installDirFile.getName());
>          if (!installDirFile.isDirectory())
>          {
>            System.out.println("installDirFile is a folder!!");
>            System.out.println("Could not find installation directory; "
>              + installDirFile.getCanonicalPath()
>              + " does not appear to be a valid directory");
>          }
>
>          sInstallPath = installDirFile.getCanonicalPath().replace(
>            File.separatorChar, '/');
>          System.out.println("sInstallPath = "+sInstallPath);
> //        }
> //        else
> //        {
> //          System.out.println(
> //            "Cannot determine installation directory; apparently not 
> running from a jar");
> //        }
> //      }
> //      else
> //      {
> //        override = override.replace('\\', '/');
> //        System.out.println("override = "+override);
> //        int pos = override.lastIndexOf('/');
> //        System.out.println("pos = "+pos);
> //        if (pos < 0) {
> //          sInstallPath = "";
> //          sDevJarName = override;
> //          System.out.println("sDevJarName = "+sDevJarName);
> //        }
> //        else
> //        {
> //          sInstallPath = override.substring(0, pos);
> //          System.out.println("sInstallPath = "+sInstallPath);
> //          sDevJarName = override.substring(pos + 1);
> //          System.out.println("sDevJarName = "+sDevJarName);
> //        }
> //      }
>    }
>    catch (IOException e)
>    {
>      System.out.println("Installation problem detected, please reinstall 
> GWT"+ e.getMessage());
>    }
>  }
>
> to get back to Scott and Pawles topic..what does everybody think of a grails 
> plugin?
> Martin
> __
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
> sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
> oder Fertigung einer Kopie ist unzulaessig. Diese 

Re: Error when deploying portlets beside a normal Struts2 web app?

2009-06-12 Thread Nils-Helge Garli Hegvik
If you're using portlets, your package must extend
"struts-portlet-default" instead of "struts-default". It should be
possible to run servlet actions and portlet actions in the same
application.

Nils-H


On Thu, Jun 11, 2009 at 3:52 PM, IainM wrote:
>
> Hi,
>
> I have an existing Struts2 (2.1.6) web app which I would like to add a
> couple of portlets to. I have added the portlet plugin and a portel.xml file
> and developed a couple of plugins which I have successfully run in JBOSS
> Portal. My problem is that the addition of the portlet plugin
> (struts2-portlet-plugin-2.1.6) seems to break my existing web pages. For
> example, when I have an action which forwards onto a very plain jsp file
> that shows a form (using ) I get a NullPointerException as below:
>
> org.apache.jasper.JasperException: java.lang.NullPointerException
>
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:521)
>
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:415)
>        
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
>        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
>        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>       etc...
>
> root cause
>
> java.lang.NullPointerException
>        org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:792)
>        org.apache.struts2.components.UIBean.end(UIBean.java:510)
>
> org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
>
> org.apache.jsp.cardSearch_jsp._jspx_meth_s_005ftextfield_005f0(cardSearch_jsp.java:583)
>
> org.apache.jsp.cardSearch_jsp._jspx_meth_s_005fform_005f0(cardSearch_jsp.java:530)
>        org.apache.jsp.cardSearch_jsp._jspService(cardSearch_jsp.java:296)
>        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
>        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
>        
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
>        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
>        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
> org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:154)
>
> org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
>        etc.
>
> If I remove the portlet plugin (and the portlet.xml file which points to one
> of the classes from the plugin) all of my original webpages work without any
> issues so it's definetly the plugin that's causing a conflict.
>
> Can I not deploy a struts2 application that includes both normal web pages
> and portlets? Or is there a way around this problem.
>
> Any help would be greatly appreciated.
>
> Iain.
> --
> View this message in context: 
> http://www.nabble.com/Error-when-deploying-portlets-beside-a-normal-Struts2-web-app--tp23981728p23981728.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: opening a popup window from Action Class

2009-06-10 Thread Nils-Helge Garli Hegvik
That's something you have to handle in your view, either with
javascript or just a link with the proper target attribute.

Nils-H

On Thu, Jun 11, 2009 at 8:03 AM, abhishek reddy wrote:
> hi every one,
>
> How to open a popup window from Struts Action Class?
>
> thanks in advance
> --
> Abhishek
>

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



Re: Re [S2] development tool

2009-06-08 Thread Nils-Helge Garli Hegvik
I don't think anyone is _threatened_ by RAD tools. To be a threat,
they would have to be better than the alternatives And they're
not I have yet to see a RAD (as in point and click programming)
tool that is actually more productive taking the entire lifecycle of a
development project into consideration. The reason we're (I'm) so
against it is having those tools pushed down our throats by some
non-technology guy who just came home from a golf trip with someone
from their software partner (btw: I'm not referring to you ;)... I
would certainly welcome any tool that actually makes developing and
maintaining web applications easier.

Nils-H

On Fri, Jun 5, 2009 at 10:19 PM,  wrote:
> To the group:
> How threatened do you feel toward RAD tools? Do you feel that a RAD
> environment would take your 5 man team to a one-man team, or do you see
> (company-mentality) the 5 man team taking the company to market 5 times
> faster(overall SDLC) and seeing new projects( that appear out of reach)
> becoming a reality? Do you look at the company having a real competitive
> advantage, or do you see job cuts? I agree that, in this market, things look
> a little dim. How less-dim do things look(for the company) when budget
> constraints are loosened and projects start moving again?  I guess this is a
> question of: is your glass half-full or half empty?
>
> Think big!
> Duane
>
> --
> From: 
> Sent: Friday, June 05, 2009 2:07 PM
> To: "struts-user" 
> Subject: Re [S2] development tool
>
>> I noticed the posting on training was not met with huge opposition for
>> solicitation in the manner it was presented...
>> My turn  :>
>>
>> We've been toying with creating a development tool/methodology that
>> encompases Struts, Spring, Hibernate, some code generation(not 1 screen at a
>> time, but a replication of complete cataloged solution).  My question is:
>> what model would the community best receive of the following:
>>
>> -license, $X.00 month per seat
>> -free development license and non-commercial runtime, commercial runtime
>> fee per cpu
>> -combination of the first two(lesser per seat license combined with a
>> runtime license)
>>
>> The core features of the tool are
>> -20X faster development compared to current market alternatives
>> -90% point and click development(business rules must be coded) which
>> allows developers to focus on business, not assembling technologies and
>> frameworks
>> -new frameworks can be induced by modifying catalog. Once written, never
>> write it again
>> -Portal style look and feel, comes with role-base
>> authentication/authorization out-of-the-box
>> -custom tag libraries are advanced and easy to use, makes application
>> integration(and long term maintenance) simpler
>> -enables daily scrum sessions in an agile development environment
>> -all major App Servers supported
>> -all major Database supported
>> -java version is production ready
>> -C#/.Net version is due out in a few months 80% complete(looking for
>> developers, send resume if you like to contribute)
>>
>> I'll demo the platform to anyone interested. Just write and express
>> interest and we can do this online with Skype and GoToMeeting
>>
>> If you are interested in outsourcing. I have developers fluent with this
>> tool that are looking for projects.
>> Thanks for your consideration
>>
>> Duane
>>
>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: Doubts about new project (Struts2 good way to do it?)

2009-06-08 Thread Nils-Helge Garli Hegvik
> could you elaborate on how JetSpeed is not JSR-168 compliant?
>
> thanks,
> Martin Gainty

You have to start actually reading the posts you're replying to. I
said nowhere that JetSpeed is not JSR-168 compliant. And please, keep
discussions on the list.

Nils-H

>
>
>> Date: Mon, 8 Jun 2009 13:00:07 +0200
>> Subject: Re: Doubts about new project (Struts2 good way to do it?)
>> From: nil...@gmail.com
>> To: user@struts.apache.org
>>
>> Jetspeed2 - No, JSR168 portlets - Yes. You should be aware of the
>> features and limitations of portlets though. It might not necessarily
>> be what you're looking for. I suggest digging a bit deeper into the
>> topic if you're considering using it.
>>
>> Nils-H
>>
>> On Mon, Jun 8, 2009 at 9:05 AM, Francisco
>> Exposito wrote:
>> >
>> > Has anyone an example of jetspeed2 + struts2?
>> >
>> >> Date: Fri, 5 Jun 2009 14:24:28 +0200
>> >> Subject: Re: Doubts about new project (Struts2 good way to do it?)
>> >> From: poulw...@gmail.com
>> >> To: user@struts.apache.org
>> >>
>> >> Hi Francisco,
>> >> free hosting for java can be a hard one to find,
>> >> i don't know or heard of any.
>> >>
>> >> Best greetings,
>> >> Paweł Wielgus.
>> >>
>> >>
>> >> 2009/6/5 Francisco Exposito :
>> >> >
>> >> > I've read that jetspeed2 documentation is poor... do you have an
>> >> > example about jetspeed2 + struts2?
>> >> >
>> >> > Then, is it possible to create a project using:
>> >> >
>> >> > Struts2, Jetspeed2, Spring plugin, Hibernate and Sitemesh? or
>> >> > jetspeed is not compatible with the other? And what about the 
>> >> > performance?
>> >> > Could it be ok using all that? And is it possible to use them in Tomcat 
>> >> > or
>> >> > it is necessary JBoss? I want to find a free hosting and if it is 
>> >> > difficult
>> >> > to find in TomI tcat... I don't want to think in JBoss...
>> >> >
>> >> > Regards,
>> >> > Francisco
>> >> >
>> >> >> From: mgai...@hotmail.com
>> >> >> To: user@struts.apache.org
>> >> >> Subject: RE: Doubts about new project (Struts2 good way to do it?)
>> >> >> Date: Thu, 4 Jun 2009 15:43:55 -0400
>> >> >>
>> >> >>
>> >> >> Good Afternoon Francisco
>> >> >> i have an opinion on the subject which i would be more than happy to
>> >> >> share with you
>> >> >>
>> >> >> > 1) User preferences: every user can configure its "window" and
>> >> >> maintain its configuration after save preferences and log in again.
>> >> >> The
>> >> >> user can select options from a list and position them where he
>> >> >> wants.
>> >> >> ¿Maybe using portlets?¿Changing css dinamically depending on logged
>> >> >> user?¿Any other option?
>> >> >> MG>JetSpeed..tried and true Principal assignment to User,Group
>> >> >> http://portals.apache.org/jetspeed-2/
>> >> >>
>> >> >> > 2) Languages: every user can
>> >> >> access in some languages. As I've tested, the language is configured
>> >> >> with regional settings. But it is possible to select the language in
>> >> >> the login page and maintain it during the session?
>> >> >> MG>simple as setting request_locate to en requst_locale=es
>> >> >> MG>http://struts.apache.org/2.1.6/docs/how-do-we-change-locales.html
>> >> >> >
>> >> >> > 3) Persistence layer: better Hibernate or iBatis? About
>> >> >> > performance?
>> >> >> MG>I think hibernate has more deploys be aware of lazy_init not
>> >> >> creating all dependent objects in object graph
>> >> >> https://www.hibernate.org/162.html
>> >> >> >
>> >> >> > 4) E-commerce: shop cart, what about security?
>> >> >> MG>SSL all the way..dont send cleartext for anything unless you want
>> >> >> mailicious eavesdropper intervention!
>> >> >> http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html
>> >> >> MG>i can give you SSL solutions for OAS, WL, Resin, JBOSS if you
>> >> >> need it
>> >> >> >
>> >> >> > 5) Sitemesh or Tiles? I've used tiles and it is ok, but the xml
>> >> >> > are too long. About performance?
>> >> >> MG>Sitemesh is the css handler that is preconfigured for Struts
>> >> >>     
>> >> >>         sitemesh
>> >> >>
>> >> >> com.opensymphony.module.sitemesh.filter.PageFilter
>> >> >>     
>> >> >>     
>> >> >>         sitemesh
>> >> >>         /*
>> >> >>     
>> >> >>
>> >> >> MG>if you like using VM macros coded thru SiteMesh then enable
>> >> >> VelocityPageFilter in web.xml
>> >> >>         
>> >> >>             sitemesh
>> >> >>
>> >> >> org.apache.struts2.sitemesh.VelocityPageFilter
>> >> >>         
>> >> >>         
>> >> >>             sitemesh
>> >> >>             /*
>> >> >>         
>> >> >>
>> >> >> and for freemarker
>> >> >>     
>> >> >>         sitemesh
>> >> >>
>> >> >> org.apache.struts2.sitemesh.FreeMarkerPageFilter
>> >> >>     
>> >> >>         
>> >> >>
>> >> >>             sitemesh
>> >> >>
>> >> >>             /*
>> >> >>
>> >> >>         
>> >> >>
>> >> >>
>> >> >> Saludos Cordiales desde EEUU!
>> >> >> Martin
>> >> >> GMT+5(esta semana)
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > The options I've considered are:
>> >> >> >
>> >> >> > Tomcat, MySQL, Struts2 wi

Re: Doubts about new project (Struts2 good way to do it?)

2009-06-08 Thread Nils-Helge Garli Hegvik
Jetspeed2 - No, JSR168 portlets - Yes. You should be aware of the
features and limitations of portlets though. It might not necessarily
be what you're looking for. I suggest digging a bit deeper into the
topic if you're considering using it.

Nils-H

On Mon, Jun 8, 2009 at 9:05 AM, Francisco
Exposito wrote:
>
> Has anyone an example of jetspeed2 + struts2?
>
>> Date: Fri, 5 Jun 2009 14:24:28 +0200
>> Subject: Re: Doubts about new project (Struts2 good way to do it?)
>> From: poulw...@gmail.com
>> To: user@struts.apache.org
>>
>> Hi Francisco,
>> free hosting for java can be a hard one to find,
>> i don't know or heard of any.
>>
>> Best greetings,
>> Paweł Wielgus.
>>
>>
>> 2009/6/5 Francisco Exposito :
>> >
>> > I've read that jetspeed2 documentation is poor... do you have an example 
>> > about jetspeed2 + struts2?
>> >
>> > Then, is it possible to create a project using:
>> >
>> > Struts2, Jetspeed2, Spring plugin, Hibernate and Sitemesh? or jetspeed is 
>> > not compatible with the other? And what about the performance? Could it be 
>> > ok using all that? And is it possible to use them in Tomcat or it is 
>> > necessary JBoss? I want to find a free hosting and if it is difficult to 
>> > find in TomI tcat... I don't want to think in JBoss...
>> >
>> > Regards,
>> > Francisco
>> >
>> >> From: mgai...@hotmail.com
>> >> To: user@struts.apache.org
>> >> Subject: RE: Doubts about new project (Struts2 good way to do it?)
>> >> Date: Thu, 4 Jun 2009 15:43:55 -0400
>> >>
>> >>
>> >> Good Afternoon Francisco
>> >> i have an opinion on the subject which i would be more than happy to 
>> >> share with you
>> >>
>> >> > 1) User preferences: every user can configure its "window" and
>> >> maintain its configuration after save preferences and log in again. The
>> >> user can select options from a list and position them where he wants.
>> >> ¿Maybe using portlets?¿Changing css dinamically depending on logged
>> >> user?¿Any other option?
>> >> MG>JetSpeed..tried and true Principal assignment to User,Group
>> >> http://portals.apache.org/jetspeed-2/
>> >>
>> >> > 2) Languages: every user can
>> >> access in some languages. As I've tested, the language is configured
>> >> with regional settings. But it is possible to select the language in
>> >> the login page and maintain it during the session?
>> >> MG>simple as setting request_locate to en requst_locale=es
>> >> MG>http://struts.apache.org/2.1.6/docs/how-do-we-change-locales.html
>> >> >
>> >> > 3) Persistence layer: better Hibernate or iBatis? About performance?
>> >> MG>I think hibernate has more deploys be aware of lazy_init not creating 
>> >> all dependent objects in object graph
>> >> https://www.hibernate.org/162.html
>> >> >
>> >> > 4) E-commerce: shop cart, what about security?
>> >> MG>SSL all the way..dont send cleartext for anything unless you want 
>> >> mailicious eavesdropper intervention!
>> >> http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html
>> >> MG>i can give you SSL solutions for OAS, WL, Resin, JBOSS if you need it
>> >> >
>> >> > 5) Sitemesh or Tiles? I've used tiles and it is ok, but the xml are too 
>> >> > long. About performance?
>> >> MG>Sitemesh is the css handler that is preconfigured for Struts
>> >>     
>> >>         sitemesh
>> >>         
>> >> com.opensymphony.module.sitemesh.filter.PageFilter
>> >>     
>> >>     
>> >>         sitemesh
>> >>         /*
>> >>     
>> >>
>> >> MG>if you like using VM macros coded thru SiteMesh then enable 
>> >> VelocityPageFilter in web.xml
>> >>         
>> >>             sitemesh
>> >>             
>> >> org.apache.struts2.sitemesh.VelocityPageFilter
>> >>         
>> >>         
>> >>             sitemesh
>> >>             /*
>> >>         
>> >>
>> >> and for freemarker
>> >>     
>> >>         sitemesh
>> >>         
>> >> org.apache.struts2.sitemesh.FreeMarkerPageFilter
>> >>     
>> >>         
>> >>
>> >>             sitemesh
>> >>
>> >>             /*
>> >>
>> >>         
>> >>
>> >>
>> >> Saludos Cordiales desde EEUU!
>> >> Martin
>> >> GMT+5(esta semana)
>> >> >
>> >> >
>> >> >
>> >> > The options I've considered are:
>> >> >
>> >> > Tomcat, MySQL, Struts2 with Spring IOC and open in view filter, 
>> >> > Sitemesh or Tiles, Hibernate or iBatis, Portlets.
>> >> >
>> >> > Other option is use JSF. Which selection do you think would be better?
>> >> >
>> >>
>> >>
>> >> Martin Gainty
>> >> __
>> >> Jogi és Bizalmassági kinyilatkoztatás/Verzicht und 
>> >> Vertraulichkeitanmerkung/Note de déni et de confidentialité
>> >>  Ez az
>> >> üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
>> >> jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
>> >> készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
>> >> semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
>> >> könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
>> >> ezen üzenet tartalma miatt.
>> >>
>

Re: response.sendRedirect() with Struts2 within a portlet

2009-05-31 Thread Nils-Helge Garli Hegvik
Unfortunately, you can't make an ajax request to the portlet. The ajax
tags are not supported in a portlet, due to limitations in the JSR168
specification. Also, I'm not quite sure what you're trying to do. Are
you attempting to load the div with Ajax with contents from a
different url? Have you considered using an iframe?

Nils-H

On Sun, May 31, 2009 at 10:32 PM, Crishantha Nanayakkara
 wrote:
>
> Hi Nils-H,
>
> I got it working by using "ActionResponse aResponse =
> PortletActionContext.getActionResponse();" within the execute() method of
> the action event.
>
> Actually my main requirement is to redirect to an external URL within my
> portlet itself. For me to confine the external URL within the portlet
> window, I am using the Struts2 Ajax div tag within my jsp code.
>
> See the JSP code below,
>
> 
>
> 
>
> 
>        
>        
>         href="%{#url}" />
> 
>
> My execute() method looks like below,
>
>        public String execute() throws Exception {
>                System.out.println("*** In the EXECUTE() method ");
>                System.out.println("The request object is : " + request);
>
>                ActionRequest aRequest =
> PortletActionContext.getActionRequest();
>                System.out.println("The Action request object is : " +
> aRequest);
>
>                ActionResponse aResponse =
> PortletActionContext.getActionResponse();
>                System.out.println("The Action response object is : " +
> aResponse);
>
>                aResponse.sendRedirect("http://www.google.lk";);
>
>                return SUCCESS;
>        }
>
> However, when I run this, The external URL is not loaded to the portlet
> window. It says "undefined" within div tags.
>
> What should I do to make this work?
>
> Best Regards
> Crishantha
>
> Nils-Helge Garli wrote:
>>
>> You can use the PortletResponseAware to get the portlet response object.
>>
>> Nnils-H
>>
>> On Sun, May 31, 2009 at 10:20 AM, Crishantha Nanayakkara
>>  wrote:
>>>
>>> Hi,
>>>
>>> I have a requirement to use a response.sendRedirect() within my Action
>>> class. Basically this action class is used to manipulate a porltet.
>>>
>>> Unlike Struts1, we do not directly have any processAction() method and
>>> ActionRequest and ActionResponse objects to do a response.sendRedirect.
>>>
>>> I just want to know how do we get about executing the
>>> response.sendRedirect
>>> with Struts2? What should be the interface to implement within the action
>>> class to do this. (Just like ServletRequestAware to get the
>>> HttpServletRequest)
>>>
>>> Appriciate your help on this.
>>>
>>> Best Regards
>>> Crishantha
>>> --
>>> View this message in context:
>>> http://www.nabble.com/response.sendRedirect%28%29-with-Struts2-within-a-portlet-tp23800916p23800916.html
>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/response.sendRedirect%28%29-with-Struts2-within-a-portlet-tp23800916p23806654.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: Struts 2 going to hang glassfish

2009-05-31 Thread Nils-Helge Garli Hegvik
I'm sure you realize that for anyone to be able to help, you have to
provide some more information... Besides, I'd be surprised if you
can't find any trace of anything in your logs.

Nils-H

On Sun, May 31, 2009 at 6:05 PM, mohsen ahmadian  wrote:
> Hello to all
>  I have a project with Struts 2 ,Dojo , EJB 3 on glassfish 2.1
> but when i click more than on one link OR when user switch IE8 to IE7
> glassfish going to down!
> Please help me urgently
> Thank you
>

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



Re: response.sendRedirect() with Struts2 within a portlet

2009-05-31 Thread Nils-Helge Garli Hegvik
You can use the PortletResponseAware to get the portlet response object.

Nnils-H

On Sun, May 31, 2009 at 10:20 AM, Crishantha Nanayakkara
 wrote:
>
> Hi,
>
> I have a requirement to use a response.sendRedirect() within my Action
> class. Basically this action class is used to manipulate a porltet.
>
> Unlike Struts1, we do not directly have any processAction() method and
> ActionRequest and ActionResponse objects to do a response.sendRedirect.
>
> I just want to know how do we get about executing the response.sendRedirect
> with Struts2? What should be the interface to implement within the action
> class to do this. (Just like ServletRequestAware to get the
> HttpServletRequest)
>
> Appriciate your help on this.
>
> Best Regards
> Crishantha
> --
> View this message in context: 
> http://www.nabble.com/response.sendRedirect%28%29-with-Struts2-within-a-portlet-tp23800916p23800916.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: Error in Jasper printReport

2009-05-28 Thread Nils-Helge Garli Hegvik
Maybe you should try a Jasper mailing list?

Nils-H

On Fri, May 29, 2009 at 8:19 AM, Ikya Technical  wrote:
> Hi,
>
>     Whenever I am giving true in
>
>                        JasperPrintManager.printReport(jasperPrint, true)
>
>    it is throwing the error
>
>                net.sf.jasperreports.engine.JRException: Error printing report.
>
>
>     But if I am giving it as JasperPrintManager.printReport(jasperPrint,
> false) it is working fine.
>
>     Am I missing any library for this?
>
> Regards,
> Sreekanth
>

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



Re: how to get productID from the url into action class.

2009-05-28 Thread Nils-Helge Garli Hegvik
Obviously, something must be wrong if something as simple as setting
an action property doesn't work. Are you sure that the url to the
action is generated correctly? Try using the s:url tag instead of
assembling the url and parameter "by hand". Also, you have not showed
your struts.xml.

I suggest you start again from the beginning, remove everything, just
leave a simple action with the execute method, the getter and the
setter for the property, nothing else. Then get that to work. You can
also use the bootstrap tutorials as a starting point.

Nils-H

On Thu, May 28, 2009 at 12:41 PM, Prashant Singh
 wrote:
> Hi Nils,
>
> this is what I have tried to do till today.
>
> http://www.coderanch.com/t/446930/Struts/transfer-productID-from-url-action
>
> Sincerely,
> Prashant
>
>
>
> --- On Thu, 28/5/09, Nils-Helge Garli Hegvik  wrote:
>
>
> From: Nils-Helge Garli Hegvik 
> Subject: Re: how to get productID from the url into action class.
> To: "Struts Users Mailing List" 
> Date: Thursday, 28 May, 2009, 3:59 PM
>
>
> If you take a step back, and remove what you have tried to do now,
> what did you try, and what didn't work?
>
> Nils-H
>
> On Thu, May 28, 2009 at 12:22 PM, Prashant Singh
>  wrote:
>> Hi Nils,
>>
>> Please pardon me if I am appearing silly but I 've been trying to get the 
>> productID from the jsp to the action class for 3 days without any luck.
>>
>> I have got out list of products from the database and I have displayed them 
>> on a jsp using struts 2 tags .
>>
>> Now what I want to do is to have a all the products appear as hyperlinks so 
>> that when I click on the products its going to show all the suppliers 
>> associated with the products. So i've tried to create a code as follows:
>>
>> 
>> ">
>> 
>> 
>> 
>>
>> the action showprodsuppliers is mapped to the action class I have posted in 
>> the last email.
>>
>> this is generating a url as follows:
>> http://localhost:8080/Astralpharma1/astralpharma/astralpharma/showprodsuppliers.action?productID=1
>>
>> I just need to retrieve the productID from the url. thats it
>>
>> Please let me know how so I do that in Struts 2
>>
>> Thanks
>> Prashant
>>
>> --- On Thu, 28/5/09, Nils-Helge Garli Hegvik  wrote:
>>
>>
>> From: Nils-Helge Garli Hegvik 
>> Subject: Re: how to get productID from the url into action class.
>> To: "Struts Users Mailing List" 
>> Date: Thursday, 28 May, 2009, 3:22 PM
>>
>>
>> When I think of it, that doesn't make any sense either... Isn't the
>> product id set as a property on your action?
>>
>> Nils-H
>>
>> 2009/5/28 Nils-Helge Garli Hegvik :
>>> Um... What exactly are you trying to do here? Do you just need the product 
>>> id from the url string, or are you trying to fetch something from a 
>>> different backend? If you just need it from the string, just use indexOf 
>>> and substring.
>>>
>>> Nils-H
>>>
>>> On Thu, May 28, 2009 at 11:41 AM, Prashant Singh 
>>>  wrote:
>>>>
>>>>
>>>>
>>>>
>>>> Hi dear,
>>>>
>>>> I have been trying to read the productID from the url but it goes into an 
>>>> infinite loop at point 1. I am posting the code below. Please help.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>  package net.astralpharma;
>>>> import java.io.*;
>>>> import com.opensymphony.xwork2.ActionContext;
>>>> import com.opensymphony.xwork2.ActionSupport;
>>>> import org.apache.struts2.ServletActionContext;
>>>>
>>>> import java.io.BufferedReader;
>>>> import java.io.IOException;
>>>> import java.net.URL;
>>>> import java.net.URLConnection;
>>>> import java.sql.*;
>>>> import java.util.*;
>>>>
>>>> import net.astralpharma.Connect;
>>>> import net.astralpharma.Product;
>>>> import net.astralpharma.Productdisplay;
>>>>
>>>> public class Showprodsuppliers extends ActionSupport
>>>> {
>>>> private String productID;
>>>> private String productName;
>>>> List supplierName = new ArrayList();
>>>>
>>>>
>>>> public String execute() throws Exception{
>>>> StringBuffer sb = new StringBuffer("http://localhost:8080/Astralpharma1/ast

Re: how to get productID from the url into action class.

2009-05-28 Thread Nils-Helge Garli Hegvik
I think the mailing list is messing with the order of messages

However,

Documentation and code snippets can be found here:
http://struts.apache.org/2.1.6/docs/bootstrap.html

Basically, map your action in struts.xml, add the appropriate
getter/setter in your action, and it should automagically be set from
the url to your action. If that doesn't work, then there's something
wrong with your setup.

Nils-H


On Thu, May 28, 2009 at 12:33 PM, Prashant Singh
 wrote:
> Hi Nils,
>
> can you please illustrate with a code snippet.
>
> Thanks,
> Prashant
>
> --- On Thu, 28/5/09, Nils-Helge Garli Hegvik  wrote:
>
>
> From: Nils-Helge Garli Hegvik 
> Subject: Re: how to get productID from the url into action class.
> To: "Struts Users Mailing List" 
> Date: Thursday, 28 May, 2009, 3:19 PM
>
>
> Um... What exactly are you trying to do here? Do you just need the
> product id from the url string, or are you trying to fetch something
> from a different backend? If you just need it from the string, just
> use indexOf and substring.
>
> Nils-H
>
> On Thu, May 28, 2009 at 11:41 AM, Prashant Singh
>  wrote:
>>
>>
>>
>>
>> Hi dear,
>>
>> I have been trying to read the productID from the url but it goes into an 
>> infinite loop at point 1. I am posting the code below. Please help.
>>
>>
>>
>>
>>
>>
>>  package net.astralpharma;
>> import java.io.*;
>> import com.opensymphony.xwork2.ActionContext;
>> import com.opensymphony.xwork2.ActionSupport;
>> import org.apache.struts2.ServletActionContext;
>>
>> import java.io.BufferedReader;
>> import java.io.IOException;
>> import java.net.URL;
>> import java.net.URLConnection;
>> import java.sql.*;
>> import java.util.*;
>>
>> import net.astralpharma.Connect;
>> import net.astralpharma.Product;
>> import net.astralpharma.Productdisplay;
>>
>> public class Showprodsuppliers extends ActionSupport
>> {
>> private String productID;
>> private String productName;
>> List supplierName = new ArrayList();
>>
>>
>> public String execute() throws Exception{
>> StringBuffer sb = new StringBuffer("http://localhost:8080/Astralpharma1/astralpharma/astralpharma/showprodsuppliers.action?productID=1";);
>>
>> URL url = new URL(sb.toString());
>> URLConnection urlConn = url.openConnection();
>> urlConn.setUseCaches(true);
>> urlConn.setDoOutput(true);
>> urlConn.setDoInput(true);
>> System.out.println("reached point 1");
>>
>> OutputStreamWriter osr = new OutputStreamWriter(urlConn.getOutputStream());
>>
>> BufferedReader br = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
>>
>> String tempStr;
>> StringBuffer buffer = new StringBuffer();
>> System.out.println("Reached point 2");
>>
>> while((tempStr = br.readLine())!= null)
>> {
>> buffer.append(tempStr + "\n");
>>
>> }
>> br.close();
>>
>> StringTokenizer st = new StringTokenizer(buffer.toString());
>> ArrayList output = new ArrayList();
>> System.out.println("reached point 3");
>> while(st.hasMoreTokens())
>> {
>> String server = st.nextToken();
>> try{
>> if(st.nextToken().contentEquals("productID"));
>> {
>> productID=st.nextToken().valueOf("productID");
>> System.out.println("Value of productID" + productID);
>> }
>> }
>> catch(Exception e)
>> {
>> System.out.println("Exception" + e.getMessage());
>> }
>> }
>> System.out.println("Reached point 4");
>>
>> Connect connect = new Connect();
>> Connection con = connect.useConnection();
>> String query="Select suppliername from supplier_proddetails where productid=?";
>> PreparedStatement stat = con.prepareStatement(query);
>> stat.setString(1, productID);
>> System.out.println(stat);
>> ResultSet rs = stat.executeQuery();
>> System.out.println("rs"+ rs);
>> while(rs.next())
>> {
>&

Re: how to get productID from the url into action class.

2009-05-28 Thread Nils-Helge Garli Hegvik
If you take a step back, and remove what you have tried to do now,
what did you try, and what didn't work?

Nils-H

On Thu, May 28, 2009 at 12:22 PM, Prashant Singh
 wrote:
> Hi Nils,
>
> Please pardon me if I am appearing silly but I 've been trying to get the 
> productID from the jsp to the action class for 3 days without any luck.
>
> I have got out list of products from the database and I have displayed them 
> on a jsp using struts 2 tags .
>
> Now what I want to do is to have a all the products appear as hyperlinks so 
> that when I click on the products its going to show all the suppliers 
> associated with the products. So i've tried to create a code as follows:
>
> 
> ">
> 
> 
> 
>
> the action showprodsuppliers is mapped to the action class I have posted in 
> the last email.
>
> this is generating a url as follows:
> http://localhost:8080/Astralpharma1/astralpharma/astralpharma/showprodsuppliers.action?productID=1
>
> I just need to retrieve the productID from the url. thats it
>
> Please let me know how so I do that in Struts 2
>
> Thanks
> Prashant
>
> --- On Thu, 28/5/09, Nils-Helge Garli Hegvik  wrote:
>
>
> From: Nils-Helge Garli Hegvik 
> Subject: Re: how to get productID from the url into action class.
> To: "Struts Users Mailing List" 
> Date: Thursday, 28 May, 2009, 3:22 PM
>
>
> When I think of it, that doesn't make any sense either... Isn't the
> product id set as a property on your action?
>
> Nils-H
>
> 2009/5/28 Nils-Helge Garli Hegvik :
>> Um... What exactly are you trying to do here? Do you just need the product 
>> id from the url string, or are you trying to fetch something from a 
>> different backend? If you just need it from the string, just use indexOf and 
>> substring.
>>
>> Nils-H
>>
>> On Thu, May 28, 2009 at 11:41 AM, Prashant Singh 
>>  wrote:
>>>
>>>
>>>
>>>
>>> Hi dear,
>>>
>>> I have been trying to read the productID from the url but it goes into an 
>>> infinite loop at point 1. I am posting the code below. Please help.
>>>
>>>
>>>
>>>
>>>
>>>
>>>  package net.astralpharma;
>>> import java.io.*;
>>> import com.opensymphony.xwork2.ActionContext;
>>> import com.opensymphony.xwork2.ActionSupport;
>>> import org.apache.struts2.ServletActionContext;
>>>
>>> import java.io.BufferedReader;
>>> import java.io.IOException;
>>> import java.net.URL;
>>> import java.net.URLConnection;
>>> import java.sql.*;
>>> import java.util.*;
>>>
>>> import net.astralpharma.Connect;
>>> import net.astralpharma.Product;
>>> import net.astralpharma.Productdisplay;
>>>
>>> public class Showprodsuppliers extends ActionSupport
>>> {
>>> private String productID;
>>> private String productName;
>>> List supplierName = new ArrayList();
>>>
>>>
>>> public String execute() throws Exception{
>>> StringBuffer sb = new StringBuffer("http://localhost:8080/Astralpharma1/astralpharma/astralpharma/showprodsuppliers.action?productID=1";);
>>>
>>> URL url = new URL(sb.toString());
>>> URLConnection urlConn = url.openConnection();
>>> urlConn.setUseCaches(true);
>>> urlConn.setDoOutput(true);
>>> urlConn.setDoInput(true);
>>> System.out.println("reached point 1");
>>>
>>> OutputStreamWriter osr = new OutputStreamWriter(urlConn.getOutputStream());
>>>
>>> BufferedReader br = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
>>>
>>> String tempStr;
>>> StringBuffer buffer = new StringBuffer();
>>> System.out.println("Reached point 2");
>>>
>>> while((tempStr = br.readLine())!= null)
>>> {
>>> buffer.append(tempStr + "\n");
>>>
>>> }
>>> br.close();
>>>
>>> StringTokenizer st = new StringTokenizer(buffer.toString());
>>> ArrayList output = new ArrayList();
>>> System.out.println("reached point 3");
>>> while(st.hasMoreTokens())
>>> {
>>> String server = st.nextToken();
>>> try{
>>> if(st.nextToken().contentEquals(

Re: how to get productID from the url into action class.

2009-05-28 Thread Nils-Helge Garli Hegvik
When I think of it, that doesn't make any sense either... Isn't the
product id set as a property on your action?

Nils-H

2009/5/28 Nils-Helge Garli Hegvik :
> Um... What exactly are you trying to do here? Do you just need the product id 
> from the url string, or are you trying to fetch something from a different 
> backend? If you just need it from the string, just use indexOf and substring.
>
> Nils-H
>
> On Thu, May 28, 2009 at 11:41 AM, Prashant Singh 
>  wrote:
>>
>>
>>
>>
>> Hi dear,
>>
>> I have been trying to read the productID from the url but it goes into an 
>> infinite loop at point 1. I am posting the code below. Please help.
>>
>>
>>
>>
>>
>>
>>  package net.astralpharma;
>> import java.io.*;
>> import com.opensymphony.xwork2.ActionContext;
>> import com.opensymphony.xwork2.ActionSupport;
>> import org.apache.struts2.ServletActionContext;
>>
>> import java.io.BufferedReader;
>> import java.io.IOException;
>> import java.net.URL;
>> import java.net.URLConnection;
>> import java.sql.*;
>> import java.util.*;
>>
>> import net.astralpharma.Connect;
>> import net.astralpharma.Product;
>> import net.astralpharma.Productdisplay;
>>
>> public class Showprodsuppliers extends ActionSupport
>> {
>> private String productID;
>> private String productName;
>> List supplierName = new ArrayList();
>>
>>
>> public String execute() throws Exception{
>> StringBuffer sb = new StringBuffer("http://localhost:8080/Astralpharma1/astralpharma/astralpharma/showprodsuppliers.action?productID=1";);
>>
>> URL url = new URL(sb.toString());
>> URLConnection urlConn = url.openConnection();
>> urlConn.setUseCaches(true);
>> urlConn.setDoOutput(true);
>> urlConn.setDoInput(true);
>> System.out.println("reached point 1");
>>
>> OutputStreamWriter osr = new OutputStreamWriter(urlConn.getOutputStream());
>>
>> BufferedReader br = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
>>
>> String tempStr;
>> StringBuffer buffer = new StringBuffer();
>> System.out.println("Reached point 2");
>>
>> while((tempStr = br.readLine())!= null)
>> {
>> buffer.append(tempStr + "\n");
>>
>> }
>> br.close();
>>
>> StringTokenizer st = new StringTokenizer(buffer.toString());
>> ArrayList output = new ArrayList();
>> System.out.println("reached point 3");
>> while(st.hasMoreTokens())
>> {
>> String server = st.nextToken();
>> try{
>> if(st.nextToken().contentEquals("productID"));
>> {
>> productID=st.nextToken().valueOf("productID");
>> System.out.println("Value of productID" + productID);
>> }
>> }
>> catch(Exception e)
>> {
>> System.out.println("Exception" + e.getMessage());
>> }
>> }
>> System.out.println("Reached point 4");
>>
>> Connect connect = new Connect();
>> Connection con = connect.useConnection();
>> String query="Select suppliername from supplier_proddetails where productid=?";
>> PreparedStatement stat = con.prepareStatement(query);
>> stat.setString(1, productID);
>> System.out.println(stat);
>> ResultSet rs = stat.executeQuery();
>> System.out.println("rs"+ rs);
>> while(rs.next())
>> {
>> System.out.println("inside while");
>> supplierName.add(new Supplier((rs.getString("supplierName";
>> System.out.println("item added successfully");
>> }
>> return "success";
>> }
>>
>> public List getSupplierName() {
>> return  supplierName;
>> }
>>
>> public void setSupplierName(List supplierName) {
>> this.supplierName = supplierName;
>> }
>>
>> public String  getProductID() {
>> return  productID;
>>    

Re: how to get productID from the url into action class.

2009-05-28 Thread Nils-Helge Garli Hegvik
Um... What exactly are you trying to do here? Do you just need the
product id from the url string, or are you trying to fetch something
from a different backend? If you just need it from the string, just
use indexOf and substring.

Nils-H

On Thu, May 28, 2009 at 11:41 AM, Prashant Singh
 wrote:
>
>
>
>
> Hi dear,
>
> I have been trying to read the productID from the url but it goes into an 
> infinite loop at point 1. I am posting the code below. Please help.
>
>
>
>
>
>
>  package net.astralpharma;
> import java.io.*;
> import com.opensymphony.xwork2.ActionContext;
> import com.opensymphony.xwork2.ActionSupport;
> import org.apache.struts2.ServletActionContext;
>
> import java.io.BufferedReader;
> import java.io.IOException;
> import java.net.URL;
> import java.net.URLConnection;
> import java.sql.*;
> import java.util.*;
>
> import net.astralpharma.Connect;
> import net.astralpharma.Product;
> import net.astralpharma.Productdisplay;
>
> public class Showprodsuppliers extends ActionSupport
> {
> private String productID;
> private String productName;
> List supplierName = new ArrayList();
>
>
> public String execute() throws Exception{
> StringBuffer sb = new StringBuffer("http://localhost:8080/Astralpharma1/astralpharma/astralpharma/showprodsuppliers.action?productID=1";);
>
> URL url = new URL(sb.toString());
> URLConnection urlConn = url.openConnection();
> urlConn.setUseCaches(true);
> urlConn.setDoOutput(true);
> urlConn.setDoInput(true);
> System.out.println("reached point 1");
>
> OutputStreamWriter osr = new OutputStreamWriter(urlConn.getOutputStream());
>
> BufferedReader br = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
>
> String tempStr;
> StringBuffer buffer = new StringBuffer();
> System.out.println("Reached point 2");
>
> while((tempStr = br.readLine())!= null)
> {
> buffer.append(tempStr + "\n");
>
> }
> br.close();
>
> StringTokenizer st = new StringTokenizer(buffer.toString());
> ArrayList output = new ArrayList();
> System.out.println("reached point 3");
> while(st.hasMoreTokens())
> {
> String server = st.nextToken();
> try{
> if(st.nextToken().contentEquals("productID"));
> {
> productID=st.nextToken().valueOf("productID");
> System.out.println("Value of productID" + productID);
> }
> }
> catch(Exception e)
> {
> System.out.println("Exception" + e.getMessage());
> }
> }
> System.out.println("Reached point 4");
>
> Connect connect = new Connect();
> Connection con = connect.useConnection();
> String query="Select suppliername from supplier_proddetails where productid=?";
> PreparedStatement stat = con.prepareStatement(query);
> stat.setString(1, productID);
> System.out.println(stat);
> ResultSet rs = stat.executeQuery();
> System.out.println("rs"+ rs);
> while(rs.next())
> {
> System.out.println("inside while");
> supplierName.add(new Supplier((rs.getString("supplierName";
> System.out.println("item added successfully");
> }
> return "success";
> }
>
> public List getSupplierName() {
> return  supplierName;
> }
>
> public void setSupplierName(List supplierName) {
> this.supplierName = supplierName;
> }
>
> public String  getProductID() {
> return  productID;
> }
>
> public void setProductID(String productID ) {
> this.productID  = productID ;
> }
>
>
> public String getProductName() {
> return productName;
> }
>
> public void setProductName(String productName) {
> this.productName = productName;
> }
>
> }
>
>
>
> My front end jsp is as follows:
>
> <%@ taglib prefix="s" uri="/struts-tags" %>
>
> 
> 
> Product Handled
> " rel="stylesheet"
> type="text/css"/>
> 
>
> 
> 
>
>
>
> This Page Gives the List of Products handled by Astral 
> Pharmaceuticals
>
> Products Handled
>
> 
> ">
> 
> 
> 
>
> 
>
>
> 
> 
>
> The url i am generating is as follows:
> http://localhost:8080/Astralpharma1/astralpharma/astralpharma/showprodsuppliers.action?productID=1
> I just need to get the productID from the url.
>
> Sincerely,
> Prashant Singh
>
>
>
>
>      Explore and discover exciting holidays and getaways with Yahoo! India 
> Travel http://in.travel.yahoo.com/

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

Re: how to get productID from the url into action class.

2009-05-28 Thread Nils-Helge Garli Hegvik
Um... What exactly are you trying to do here? Do you just need the
product id from the url string, or are you trying to fetch something
from a different backend? If you just need it from the string, just
use indexOf and substring.

Nils-H

On Thu, May 28, 2009 at 11:41 AM, Prashant Singh
 wrote:
>
>
>
>
> Hi dear,
>
> I have been trying to read the productID from the url but it goes into an 
> infinite loop at point 1. I am posting the code below. Please help.
>
>
>
>
>
>
>  package net.astralpharma;
> import java.io.*;
> import com.opensymphony.xwork2.ActionContext;
> import com.opensymphony.xwork2.ActionSupport;
> import org.apache.struts2.ServletActionContext;
>
> import java.io.BufferedReader;
> import java.io.IOException;
> import java.net.URL;
> import java.net.URLConnection;
> import java.sql.*;
> import java.util.*;
>
> import net.astralpharma.Connect;
> import net.astralpharma.Product;
> import net.astralpharma.Productdisplay;
>
> public class Showprodsuppliers extends ActionSupport
> {
> private String productID;
> private String productName;
> List supplierName = new ArrayList();
>
>
> public String execute() throws Exception{
> StringBuffer sb = new StringBuffer("http://localhost:8080/Astralpharma1/astralpharma/astralpharma/showprodsuppliers.action?productID=1";);
>
> URL url = new URL(sb.toString());
> URLConnection urlConn = url.openConnection();
> urlConn.setUseCaches(true);
> urlConn.setDoOutput(true);
> urlConn.setDoInput(true);
> System.out.println("reached point 1");
>
> OutputStreamWriter osr = new OutputStreamWriter(urlConn.getOutputStream());
>
> BufferedReader br = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
>
> String tempStr;
> StringBuffer buffer = new StringBuffer();
> System.out.println("Reached point 2");
>
> while((tempStr = br.readLine())!= null)
> {
> buffer.append(tempStr + "\n");
>
> }
> br.close();
>
> StringTokenizer st = new StringTokenizer(buffer.toString());
> ArrayList output = new ArrayList();
> System.out.println("reached point 3");
> while(st.hasMoreTokens())
> {
> String server = st.nextToken();
> try{
> if(st.nextToken().contentEquals("productID"));
> {
> productID=st.nextToken().valueOf("productID");
> System.out.println("Value of productID" + productID);
> }
> }
> catch(Exception e)
> {
> System.out.println("Exception" + e.getMessage());
> }
> }
> System.out.println("Reached point 4");
>
> Connect connect = new Connect();
> Connection con = connect.useConnection();
> String query="Select suppliername from supplier_proddetails where productid=?";
> PreparedStatement stat = con.prepareStatement(query);
> stat.setString(1, productID);
> System.out.println(stat);
> ResultSet rs = stat.executeQuery();
> System.out.println("rs"+ rs);
> while(rs.next())
> {
> System.out.println("inside while");
> supplierName.add(new Supplier((rs.getString("supplierName";
> System.out.println("item added successfully");
> }
> return "success";
> }
>
> public List getSupplierName() {
> return  supplierName;
> }
>
> public void setSupplierName(List supplierName) {
> this.supplierName = supplierName;
> }
>
> public String  getProductID() {
> return  productID;
> }
>
> public void setProductID(String productID ) {
> this.productID  = productID ;
> }
>
>
> public String getProductName() {
> return productName;
> }
>
> public void setProductName(String productName) {
> this.productName = productName;
> }
>
> }
>
>
>
> My front end jsp is as follows:
>
> <%@ taglib prefix="s" uri="/struts-tags" %>
>
> 
> 
> Product Handled
> " rel="stylesheet"
> type="text/css"/>
> 
>
> 
> 
>
>
>
> This Page Gives the List of Products handled by Astral 
> Pharmaceuticals
>
> Products Handled
>
> 
> ">
> 
> 
> 
>
> 
>
>
> 
> 
>
> The url i am generating is as follows:
> http://localhost:8080/Astralpharma1/astralpharma/astralpharma/showprodsuppliers.action?productID=1
> I just need to get the productID from the url.
>
> Sincerely,
> Prashant Singh
>
>
>
>
>      Explore and discover exciting holidays and getaways with Yahoo! India 
> Travel http://in.travel.yahoo.com/

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

Re: Keep Action Properties over multiple requests

2009-05-25 Thread Nils-Helge Garli Hegvik
Yes, the ScopeInterceptor should be able to handle this case.

Nils-H

On Mon, May 25, 2009 at 1:02 PM, Richard Sayre  wrote:
> I have an action that does some server side logic, based on that logic
> I want to present the user with a Yes/No message.  If they click yes I
> want to save the data the user filled out before the Yes/No message.
>
> Is it possible to carry action properties over multiple requests?  I
> found the ScopeInterceptor but I am unsure if that is what I need to
> use.
>
> Thanks
>
> Rich
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: [Struts 2] Disabled fields are not posted on form submission

2009-05-13 Thread Nils-Helge Garli Hegvik
Are you sure that you really want to disable it? Can you use a hidden
field, or hide the field with css, if you're just trying to hide it
from the user?

Nils-H

On Wed, May 13, 2009 at 11:28 AM, Fernandes Celinio
 wrote:
> Hi,
>
> Disabled fields by W3 specifications will not get posted on form
> submission (http://www.w3.org/TR/html4/interact/forms.html#h-17.12.1).
>
>                                key="Label_DateCreation"
>                        id="dateCreation"
>                        name="dateCreation"
>                        labelposition="left"
>                        maxlength="30"
>                        required="true"
>                        disabled="%{fieldDisabled}"
>        />
>
> In my case, the textfield "dateCreation" has a "disabled" attribute set
> to true (fieldDisabled is set to true).
>
> How do i submit the value of a disabled text field ?
> Is there an interceptor that already takes care of it in Struts 2 ?
>
> Thanks for helping.
>
>
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: unable to get the request parameters

2009-05-12 Thread Nils-Helge Garli Hegvik
Here's an example:
http://struts.apache.org/2.1.6/docs/interceptor-configuration.html

Note how a custom stack is defined and how the custom stack is
referring to the "defaultStack".

Nils-H

On Tue, May 12, 2009 at 1:33 PM, Murugesh  wrote:
> and also am very new to Interceptors
>
> On Tue, May 12, 2009 at 5:00 PM, Murugesh  wrote:
>
>> Thanks Nils-H.
>>
>> i am not clear. can i have the sample for this?
>>
>>   On Tue, May 12, 2009 at 4:57 PM, Nils-Helge Garli Hegvik <
>> nil...@gmail.com> wrote:
>>
>>> You have configured your interceptor as the only one in the stack.
>>> When you create your own interceptor stack, make sure you also include
>>> one of the framework stacks (e.g. basicStack).
>>>
>>> Nils-H
>>>
>>> On Tue, May 12, 2009 at 1:04 PM, Murugesh  wrote:
>>> > 
>>> >    
>>> >        
>>> >            >> > class="com.action.generic.logininterceptor"/>
>>> >        
>>> >       
>>> >       
>>> >            /login.jsp
>>> >        
>>> >       >> class="com.action.device.ManagePacketsAction"
>>> > method="show30MData">
>>> > /data.jsp
>>> > 
>>> >
>>> > I am have default interceptor named login. i am chking session
>>> validation
>>> > (like is user loggin r not ). it seems work but after running
>>>  interceptor
>>> > it backs to actionclass, here i am chking requset parameters  at that am
>>> > geeting for all parameters.
>>> >
>>> > Without interceptor everything working fine.
>>> >
>>> >
>>> >
>>> > On Tue, May 12, 2009 at 4:27 PM, Nils-Helge Garli Hegvik
>>> > wrote:
>>> >
>>> >> It would certainly be a lot easier to help if you could show your
>>> >> configuration and code...
>>> >>
>>> >> Nils-H
>>> >>
>>> >> On Tue, May 12, 2009 at 12:54 PM, Murugesh 
>>> wrote:
>>> >> >  I am doing task on struts2. In that I have to use custom
>>> >> > AutherizationInterceptor. In my custom Interceptor Im checking
>>> weather
>>> >> user
>>> >> > is in session or not. And if he tries to attempt login I gave
>>> parameter
>>> >> in
>>> >> > struts.xml as true So Im checking against it and interceptor
>>> redirects
>>> >> > action to Home. But my problem is unable to get the request
>>> parameters in
>>> >> > Any Action class if Session exist too.
>>> >> >
>>> >> > please help on this issue.
>>> >> >
>>> >>
>>> >> -
>>> >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>> >> For additional commands, e-mail: user-h...@struts.apache.org
>>> >>
>>> >>
>>> >
>>>
>>> -
>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>
>>>
>>
>

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



Re: unable to get the request parameters

2009-05-12 Thread Nils-Helge Garli Hegvik
You have configured your interceptor as the only one in the stack.
When you create your own interceptor stack, make sure you also include
one of the framework stacks (e.g. basicStack).

Nils-H

On Tue, May 12, 2009 at 1:04 PM, Murugesh  wrote:
> 
>    
>        
>             class="com.action.generic.logininterceptor"/>
>        
>       
>       
>            /login.jsp
>        
>        method="show30MData">
> /data.jsp
> 
>
> I am have default interceptor named login. i am chking session validation
> (like is user loggin r not ). it seems work but after running  interceptor
> it backs to actionclass, here i am chking requset parameters  at that am
> geeting for all parameters.
>
> Without interceptor everything working fine.
>
>
>
> On Tue, May 12, 2009 at 4:27 PM, Nils-Helge Garli Hegvik
> wrote:
>
>> It would certainly be a lot easier to help if you could show your
>> configuration and code...
>>
>> Nils-H
>>
>> On Tue, May 12, 2009 at 12:54 PM, Murugesh  wrote:
>> >  I am doing task on struts2. In that I have to use custom
>> > AutherizationInterceptor. In my custom Interceptor Im checking weather
>> user
>> > is in session or not. And if he tries to attempt login I gave parameter
>> in
>> > struts.xml as true So Im checking against it and interceptor redirects
>> > action to Home. But my problem is unable to get the request parameters in
>> > Any Action class if Session exist too.
>> >
>> > please help on this issue.
>> >
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>

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



Re: unable to get the request parameters

2009-05-12 Thread Nils-Helge Garli Hegvik
It would certainly be a lot easier to help if you could show your
configuration and code...

Nils-H

On Tue, May 12, 2009 at 12:54 PM, Murugesh  wrote:
>  I am doing task on struts2. In that I have to use custom
> AutherizationInterceptor. In my custom Interceptor Im checking weather user
> is in session or not. And if he tries to attempt login I gave parameter in
> struts.xml as true So Im checking against it and interceptor redirects
> action to Home. But my problem is unable to get the request parameters in
> Any Action class if Session exist too.
>
> please help on this issue.
>

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



Re: Not able to locate the file stored using Struts 2 file upload interceptor

2009-05-11 Thread Nils-Helge Garli Hegvik
The FileUploadInterceptor doesn't really store the file for you. It
just makes it available to your action so you can process it. After
the request has finished, the file is deleted. It should all be
described here: http://struts.apache.org/2.1.6/docs/file-upload.html

Nils-H

On Mon, May 11, 2009 at 2:58 PM, HariniKaushik  wrote:
>
> Hi all,
>
> I'm trying to upload the file using file upload interceptor.
> I have defined the setters and getters for
> upload,uploadcontenttype,uploadfilename.
> Once tats done the success page displays the path,contenttype and file name.
> File path :
> D:\Harini\apache-tomcat-6.0.18\work\Catalina\localhost\StartupPoint\upload_170b0f84_1212fa7dbf3__7ffe_.tmp
> The jsp displays the file uploaded successfuly message , content type and
> file name.
>
> But when i check inside the localhost\StartupPoint I'm unable to find that
> file(or that file is not present).
>
> Can some one help me on how to locate the file?(or change the location)
> 1.Is there any other method through which we can retrieve the lost file.
> 2.I tried to change the directory where file gets stored
> (struts.multipart.saveDir= D://Filestore) But still am not able to locate
> the file.
> Appreciate any help
>
> Thanks,
> Harini
>
> --
> View this message in context: 
> http://www.nabble.com/Not-able-to-locate-the-file-stored-using-Struts-2-file-upload-interceptor-tp23482689p23482689.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: Using session object in JSP page

2009-05-10 Thread Nils-Helge Garli Hegvik
That depends on how you want to use it. The tag reference should give
you the information you need.

http://struts.apache.org/2.1.6/docs/tag-developers-guide.html
http://struts.apache.org/2.1.6/docs/ognl.html
http://struts.apache.org/2.1.6/docs/tag-syntax.html

Nils-H

On Mon, May 11, 2009 at 7:57 AM, NR031  wrote:
>
> Hi,
>
>
>   I am having a session object created in the execute method of my action
> class like this :
>
> Map sesion=ActionContext.getContext().getSession();
> sesion.put("username",getUn());    /*getun() returns the username form field
> data*/
>
> I want to use this session data in all my JSP pages, how to use the session
> data in my JSP? I am using Struts -2 and NetBeans 6.1 IDE.
>
>
> Thnaks in advance,
>
>
> --
> View this message in context: 
> http://www.nabble.com/Using-session-object-in-JSP-page-tp23477472p23477472.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: newbie and hidden field

2009-05-10 Thread Nils-Helge Garli Hegvik
Um... I don't think those are Struts tags. Could this be what you're
using? http://www.common-controls.com/en/index.php

If yes, then you should ask your question here:
http://www.common-controls.com/bbs/?loc=en

Nils-H

On Mon, May 11, 2009 at 7:32 AM, pam  wrote:
> Hi,
> I am modifying a struts application and know nothing about struts.
> I have tags with  i managed to find the definition and wanted to have a hidden field, I have
> some javascript i want to run and store the result in a hidden field to get
> on submission.
>
> But the hidden field i made is shown when i update it.
>
> I also have a problem with the background colour, but will look through my
> css
>
> here is my tag:
>
>
>
> 
>
>  rows="3" disabled="false" required="false"
> onkeydown="OnKeydownEventOccured(event)"/>
>
>  id="scanstring" property="scanstring"/>
>
> 
>
>
>
> Thanks.
>
> Pam Withnall
> The ECN Group
> Bus.:    + 61 2 8905 4830
> Fax:     + 61 2 8905 4801
> Mobile: + 61 0415 064 958
> E: pam.withn...@ecngroup.com.au
>
>
>
>

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



Re: Converting from Struts for IBM API to Struts for JSR168

2009-05-07 Thread Nils-Helge Garli Hegvik
I'm not sure how this is related to Struts? If you are looking for
using Struts for portlet development, either check the Struts 1
portlet bridge, or use Struts 2 with the portlet plugin.

Nils-H

On Thu, May 7, 2009 at 11:17 PM, Hermann X Lau
 wrote:
> IBM API has been deprecated for Portal 6.1... does anyone have any resources 
> or tips on this conversion process?
> One of the changes is that org.apache.jetspeed.portlet is deprecated and 
> javax.portlet is its replacement.
> However, the PortletRequest class is different... under the old deprecated 
> class, we can use the getPortletSettings().getAttribute() method but that 
> method is not available in the new PortletRequest class.  Does anyone know 
> how I can get around this?
>
>
> This communication is for informational purposes only. It is not
> intended as an offer or solicitation for the purchase or sale of
> any financial instrument or as an official confirmation of any
> transaction. All market prices, data and other information are not
> warranted as to completeness or accuracy and are subject to change
> without notice. Any comments or statements made herein do not
> necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
> and affiliates.
>
> This transmission may contain information that is privileged,
> confidential, legally privileged, and/or exempt from disclosure
> under applicable law. If you are not the intended recipient, you
> are hereby notified that any disclosure, copying, distribution, or
> use of the information contained herein (including any reliance
> thereon) is STRICTLY PROHIBITED. Although this transmission and any
> attachments are believed to be free of any virus or other defect
> that might affect any computer system into which it is received and
> opened, it is the responsibility of the recipient to ensure that it
> is virus free and no responsibility is accepted by JPMorgan Chase &
> Co., its subsidiaries and affiliates, as applicable, for any loss
> or damage arising in any way from its use. If you received this
> transmission in error, please immediately contact the sender and
> destroy the material in its entirety, whether in electronic or hard
> copy format. Thank you.
>
> Please refer to http://www.jpmorgan.com/pages/disclosures for
> disclosures relating to European legal entities.

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



Re: Struts 2 UI Tags and OGNL self reference

2009-05-07 Thread Nils-Helge Garli Hegvik
If I understand your question correctly, are you looking for a
reference to the tag itself? If so, why do you need it (I'm not sure
it's possible at all)? If you're just looking for the current action,
the expression 'top' might be what you're looking for.

Nils-H

On Thu, May 7, 2009 at 6:27 PM, stanlick  wrote:
>
> Sorry about that subject line, but I couldn't think of anything simpler.
> Besides, this should cover about all the searches!
>
> I am looking to pass a "this" reference into an OGNL expressions as follows:
>
> 
>
> Apparently this is not quite the right syntax though.  I have tried a few
> combinations and decided perhaps you have this on the tip of your finger.
>
> Peace,
> Scott
> --
> View this message in context: 
> http://www.nabble.com/Struts-2-UI-Tags-and-OGNL-self-reference-tp23430564p23430564.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: Re: How to forward request in struts 2.1.6?

2009-04-30 Thread Nils-Helge Garli Hegvik
I'm not sure I understand your problem. Maybe you can give an example?
I would be surprised if you couldn't handle this with regular Struts 2
results.

http://struts.apache.org/2.1.6/docs/result-types.html
http://struts.apache.org/2.1.6/docs/result-configuration.html
http://struts.apache.org/2.1.6/docs/parameters-in-configuration-results.html

Nils-H


2009/4/30 xnpeng :
> thanks for  your reply.
> the result types cannot do my jobs in struts2+rest environment. in this 
> environment, the "success","error",... did not work, only "index","show" ,... 
> are the default result types. I can manage this.
>
> my situation is, I need to forward request to action conditionally,ie,depend 
> on "category" in action class.
>
>
>
>
> 在2009-04-29,"Nils-Helge Garli Hegvik"  写道:
>>Why do you need to do it manually with the request dispatcher? Can't
>>you use any of the available result types?
>>
>>http://struts.apache.org/2.1.6/docs/result-types.html
>>
>>Nils-H
>>
>>2009/4/29 xnpeng :
>>> from:
>>>
>>> ServletActionContext.getServletContext().getRequestDispatcher("/post/message/"+id).forward(ServletActionContext.getRequest(),ServletActionContext.getResponse());
>>>
>>> I want to forward request to http://localhost:8080/post/message/3166,
>>>
>>> but it always throws out exception says requested resource not exist.
>>>
>>> when replace the string with "/index.jsp",it can work correctly.
>>>
>>> so, anyone who can help? I just want to forward request to an ACTION other 
>>> than jsp file.
>>>
>>> thanks.
>>
>>-
>>To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>For additional commands, e-mail: user-h...@struts.apache.org
>>
>

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



Re: How to develop a Wireframe using Struts UI?

2009-04-30 Thread Nils-Helge Garli Hegvik
Um Maybe start with
http://struts.apache.org/2.1.6/docs/tutorials.html and read the docs
for the various ui tags?

Nils-H

On Thu, Apr 30, 2009 at 5:30 PM, kunduruswaroop  wrote:
>
> Please see the UI drawing below and let me know the steps to follow to
> develop a wireframe.
> http://www.nabble.com/file/p23317576/Temp.PNG Temp.PNG
>
>
>
>
> Thanks in advance.
>
> Regards,
>
> Swaroop Kunduru
> --
> View this message in context: 
> http://www.nabble.com/How-to-develop-a-Wireframe-using-Struts-UI--tp23317576p23317576.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>

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



Re: How to forward request in struts 2.1.6?

2009-04-29 Thread Nils-Helge Garli Hegvik
Why do you need to do it manually with the request dispatcher? Can't
you use any of the available result types?

http://struts.apache.org/2.1.6/docs/result-types.html

Nils-H

2009/4/29 xnpeng :
> from:
>
> ServletActionContext.getServletContext().getRequestDispatcher("/post/message/"+id).forward(ServletActionContext.getRequest(),ServletActionContext.getResponse());
>
> I want to forward request to http://localhost:8080/post/message/3166,
>
> but it always throws out exception says requested resource not exist.
>
> when replace the string with "/index.jsp",it can work correctly.
>
> so, anyone who can help? I just want to forward request to an ACTION other 
> than jsp file.
>
> thanks.

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



Re: file upload

2009-04-28 Thread Nils-Helge Garli Hegvik
Sorry, my copy & paste mistake. That file is of course in the core.

Take a look at this: http://struts.apache.org/2.1.6/docs/file-upload.html

Nils-H

On Tue, Apr 28, 2009 at 7:37 PM, PEGASUS84  wrote:
>
> no where is ths file
>
> Nils-Helge Garli wrote:
>>
>> Do you have a jar with the
>> org.apache.struts2.dispatcher.multipart.MultiPartRequest class
>> anywhere in your classpath?
>>
>> Nils-H
>>
>> On Tue, Apr 28, 2009 at 7:25 PM, PEGASUS84  wrote:
>>>
>>> please helm me
>>> i must write a code for uploading file in a directory of the server.
>>> i just try some example but i'm failed.
>>> can someone give me the code to upluoad file
>>> when i try i received this message
>>> java.lang.RuntimeException: Unable to load bean
>>> org.apache.struts2.dispatcher.multipart.MultiPartRequest (jakarta) -
>>> [unknown location]
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/file-upload-tp23282289p23282289.html
>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/file-upload-tp23282289p23282574.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: file upload

2009-04-28 Thread Nils-Helge Garli Hegvik
Do you have a jar with the
org.apache.struts2.dispatcher.multipart.MultiPartRequest class
anywhere in your classpath?

Nils-H

On Tue, Apr 28, 2009 at 7:25 PM, PEGASUS84  wrote:
>
> please helm me
> i must write a code for uploading file in a directory of the server.
> i just try some example but i'm failed.
> can someone give me the code to upluoad file
> when i try i received this message
> java.lang.RuntimeException: Unable to load bean
> org.apache.struts2.dispatcher.multipart.MultiPartRequest (jakarta) -
> [unknown location]
>
> --
> View this message in context: 
> http://www.nabble.com/file-upload-tp23282289p23282289.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



  1   2   3   4   5   >