Re: Cannot find bean: "sendJsp" in any scope

2010-03-16 Thread Andrew Sharpe
I think you want:


 


See the docs on logic:iterate for more info: 
http://struts.apache.org/1.0.2/struts-logic.html#iterate

If this still doesn't work I would recommend trying to first output a String 
property to verify you have everything setup properly.



- Original Message 
From: tesla 
To: user@struts.apache.org
Sent: Tue, March 16, 2010 10:24:13 AM
Subject: Re: Cannot find bean: "sendJsp" in any scope


When i add logic present tag to data.jsp i am not getting an error but my
page is still empty i think my arraylist is null but why? i'm waiting your
advices

tesla wrote:
> 
> Hi
> I wanna show my arrayList on the screen by using logic:iterate tag but
> when i run my application i am gettig this error.I'm working on this
> application for two days and still i cant see my arraylist elements on the
> browser.
> Thanks in advice.
> 
>  data.jsp
> 
> 
> 
>   
> 
> Book.java
> 
> public class Book {
>
> private String name;
> private String description;
> private int price;
> private int id;
> 
> public Book()
>{
>
>}
> public Book(String name)
> {
> this.name=name;
> }
> 
>  public ArrayList loadData()
>  {
>  ArrayList kitapListesi = new ArrayList();
>  kitapListesi.add(new Book("calculus1"));
>   kitapListesi.add(new Book("calculus2"));
>  return kitapListesi;
>  }
> 
> BookAction.java
> 
>   public ActionForward execute(ActionMapping mapping, ActionForm form,
> HttpServletRequest request, HttpServletResponse response)
> throws Exception {
> 
>
> BookForm bookForm = (BookForm) form;
> Book book = new Book();
> bookForm.setBookList(book.loadData());
>request.setAttribute("sendJsp", bookForm.getBookList());
> return mapping.findForward(SUCCESS);
> }
> 
> BookForm.Java
> 
> public class BookForm extends org.apache.struts.action.ActionForm {
>
>  private ArrayList bookList = new ArrayList();
> 
> public BookForm() {
> super();
> // TODO Auto-generated constructor stub
> }
> public ArrayList getBookList() {  return bookList; }
>   public void setBookList(ArrayList bookList) {  this.bookList =
> bookList; }
> 
> struts_config.xml
> 
> >
> 
>   type="paket.BookAction" >
>   
>  
> 

-- 
View this message in context: 
http://old.nabble.com/Cannot-find-bean%3A-%22sendJsp%22-in-any-scope-tp27915481p27918564.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


  __
Connect with friends from any web browser - no download required. Try the new 
Yahoo! Canada Messenger for the Web BETA at 
http://ca.messenger.yahoo.com/webmessengerpromo.php

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



Re: Can we some how persist form values in Struts2 the way we do in struts1.x

2010-03-16 Thread stanlick
Hi Sandeep --

One clean way you can do this is by using the
ScopedModelDrivenInterceptor
.

Peace,
Scott

On Tue, Mar 16, 2010 at 4:22 PM, sandeep kotha wrote:

> Hi All,
>
> We are migrating our application from Struts1.x to Struts2. Let me say we
> have some 5 pages on each page user enters different data on 5th page we
> have submit button. Clicking on submit button we insert data entered in all
> 5 pages to DB.
>
> User can navigate to previous pages to change data he entered while user
> navigating to previous pages we need to populate the data user had entered.
>
> In Struts1.x we are storing all the data in a form. In struts2 when we
> navigate to previous pages we are loosing the entered data.
>
> We welcome any suggestions to fix this issue.
>
> Thanks
> Sandeep.Kotha
>


RE: Getting the authenticated user from Spring Security for use in an Action

2010-03-16 Thread Lance Hill
I used the same method to obtain the Authentication, but it returns as null.
The user is logged in since it gets to the protected page I am accessing.
Any thoughts on how to get the properly populated SecurityContext? 


-Original Message-
From: Wes Wannemacher [mailto:w...@wantii.com] 
Sent: Tuesday, March 16, 2010 5:54 PM
To: Struts Users Mailing List
Subject: Re: Getting the authenticated user from Spring Security for use in
an Action

I use -

SecurityContextHolder.getContext().getAuthentication()

I assume that if the object returned is null, then the user isn't logged in.

I am using spring-security 2.0.4.

-Wes

On Tue, Mar 16, 2010 at 5:42 PM, Lance Hill  wrote:
> I have Spring Security set up to use CasAutheticationProvider to provide a
> UserDetails object.
>
> I did find an example that uses the SecurityContext to obtain an
> Authentication object and grab the UserDetails from there. I am not sure
how
> to get access to the populated SecurityContext since
> SecurityContextHolder.getContext() is returning an empty SecurityContext
and
> I am not sure if that is the best way to access the user.
>
>
> -Original Message-
> From: Wes Wannemacher [mailto:w...@wantii.com]
> Sent: Tuesday, March 16, 2010 5:16 PM
> To: Struts Users Mailing List
> Subject: Re: Getting the authenticated user from Spring Security for use
in
> an Action
>
> What mechanism are you using to handle authentication/authorization?
>
> -Wes
>
> On Tue, Mar 16, 2010 at 5:14 PM, Lance Hill  wrote:
>> I need to access information about the currently logged in user. I don't
>> think putting the user into the session during login is how it is
supposed
>> to be done, but I have not found examples of how to get access to the
>> current user from Spring/Spring Security. Can someone please provide a
> link
>> or brief example of the best practice?
>>
>>
>> Thank you.
>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>
>
>
> --
> Wes Wannemacher
>
> Head Engineer, WanTii, Inc.
> Need Training? Struts, Spring, Maven, Tomcat...
> Ask me for a quote!
>
> -
> 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
>
>



-- 
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

-
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: Getting the authenticated user from Spring Security for use in an Action

2010-03-16 Thread Wes Wannemacher
I use -

SecurityContextHolder.getContext().getAuthentication()

I assume that if the object returned is null, then the user isn't logged in.

I am using spring-security 2.0.4.

-Wes

On Tue, Mar 16, 2010 at 5:42 PM, Lance Hill  wrote:
> I have Spring Security set up to use CasAutheticationProvider to provide a
> UserDetails object.
>
> I did find an example that uses the SecurityContext to obtain an
> Authentication object and grab the UserDetails from there. I am not sure how
> to get access to the populated SecurityContext since
> SecurityContextHolder.getContext() is returning an empty SecurityContext and
> I am not sure if that is the best way to access the user.
>
>
> -Original Message-
> From: Wes Wannemacher [mailto:w...@wantii.com]
> Sent: Tuesday, March 16, 2010 5:16 PM
> To: Struts Users Mailing List
> Subject: Re: Getting the authenticated user from Spring Security for use in
> an Action
>
> What mechanism are you using to handle authentication/authorization?
>
> -Wes
>
> On Tue, Mar 16, 2010 at 5:14 PM, Lance Hill  wrote:
>> I need to access information about the currently logged in user. I don't
>> think putting the user into the session during login is how it is supposed
>> to be done, but I have not found examples of how to get access to the
>> current user from Spring/Spring Security. Can someone please provide a
> link
>> or brief example of the best practice?
>>
>>
>> Thank you.
>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>
>
>
> --
> Wes Wannemacher
>
> Head Engineer, WanTii, Inc.
> Need Training? Struts, Spring, Maven, Tomcat...
> Ask me for a quote!
>
> -
> 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
>
>



-- 
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

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



RE: Getting the authenticated user from Spring Security for use in an Action

2010-03-16 Thread Lance Hill
I have Spring Security set up to use CasAutheticationProvider to provide a
UserDetails object. 

I did find an example that uses the SecurityContext to obtain an
Authentication object and grab the UserDetails from there. I am not sure how
to get access to the populated SecurityContext since
SecurityContextHolder.getContext() is returning an empty SecurityContext and
I am not sure if that is the best way to access the user.


-Original Message-
From: Wes Wannemacher [mailto:w...@wantii.com] 
Sent: Tuesday, March 16, 2010 5:16 PM
To: Struts Users Mailing List
Subject: Re: Getting the authenticated user from Spring Security for use in
an Action

What mechanism are you using to handle authentication/authorization?

-Wes

On Tue, Mar 16, 2010 at 5:14 PM, Lance Hill  wrote:
> I need to access information about the currently logged in user. I don't
> think putting the user into the session during login is how it is supposed
> to be done, but I have not found examples of how to get access to the
> current user from Spring/Spring Security. Can someone please provide a
link
> or brief example of the best practice?
>
>
> Thank you.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>



-- 
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

-
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



Can we some how persist form values in Struts2 the way we do in struts1.x

2010-03-16 Thread sandeep kotha
Hi All,

We are migrating our application from Struts1.x to Struts2. Let me say we
have some 5 pages on each page user enters different data on 5th page we
have submit button. Clicking on submit button we insert data entered in all
5 pages to DB.

User can navigate to previous pages to change data he entered while user
navigating to previous pages we need to populate the data user had entered.

In Struts1.x we are storing all the data in a form. In struts2 when we
navigate to previous pages we are loosing the entered data.

We welcome any suggestions to fix this issue.

Thanks
Sandeep.Kotha


Re: Getting the authenticated user from Spring Security for use in an Action

2010-03-16 Thread Wes Wannemacher
What mechanism are you using to handle authentication/authorization?

-Wes

On Tue, Mar 16, 2010 at 5:14 PM, Lance Hill  wrote:
> I need to access information about the currently logged in user. I don't
> think putting the user into the session during login is how it is supposed
> to be done, but I have not found examples of how to get access to the
> current user from Spring/Spring Security. Can someone please provide a link
> or brief example of the best practice?
>
>
> Thank you.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>



-- 
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

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



Getting the authenticated user from Spring Security for use in an Action

2010-03-16 Thread Lance Hill
I need to access information about the currently logged in user. I don't
think putting the user into the session during login is how it is supposed
to be done, but I have not found examples of how to get access to the
current user from Spring/Spring Security. Can someone please provide a link
or brief example of the best practice?


Thank you.


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



Re: Struts2 + Sitemesh + Freemarker doesn't work

2010-03-16 Thread Lukasz Lenart
2010/3/16 jonathan doklovic :
> I was able to resolve the issue simply by using the snapshot jar listed on
> this blog post: http://www.stonescape.net/roller/xtian/date/20091021
>
> My web.xml was correct, just needed the updated sitemesh plugin.

Here you have the whole build
http://hudson.zones.apache.org/hudson/view/Struts/job/struts2/193/

I added proper web.xml config for full integration with SiteMesh 2 +
Freemarker 2.4.2 + Velocity 1.3 , including Struts 2 Tags, ValueStack,
and FreemarkerManager statics.
http://struts.apache.org/2.x/docs/sitemesh-plugin.html


Regards
-- 
Łukasz
http://www.lenart.org.pl/
Kapituła Javarsovia 2010
http://javarsovia.pl

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



Re: Struts2 + Sitemesh + Freemarker doesn't work

2010-03-16 Thread jonathan doklovic
I was able to resolve the issue simply by using the snapshot jar listed 
on this blog post: http://www.stonescape.net/roller/xtian/date/20091021


My web.xml was correct, just needed the updated sitemesh plugin.


jonathan doklovic wrote:
It seems that the patch mentioned in WW-3296 would fix my problem, 
however it lists:



   sitemesh-freemarker
   
org.apache.struts2.sitemesh.FreemarkerDecoratorServlet 


   
   default_encoding
   UTF-8
   
   1
   

But that class doesn't exist in the 2.1.8.1 release.  I think it's 
only applied to struts 2.2.0 but I can't find a build of 2.2.0 anywhere.


I've also tried every combination of filters/servlets, including the 
com.opensymphony.sitemesh.webapp.SiteMeshFilter and nothing works.


I could attached my webapp, but if it's already fixed in 2.2.0, I'm 
guessing I'll just have to wait for that?


- Jonathan


Wes Wannemacher wrote:

I am not decorating JSP with freemarker decorators, I am decorating
JSP with JSP, but I use the following filter -


sitemesh

com.opensymphony.sitemesh.webapp.SiteMeshFilter 




The filter you are using might be buggy... I don't know if it has seen
any attention in a while. If you get a moment, whip up a simple
example web-app that demonstrates the problem and create a JIRA on it.
A quick look in JIRA shows that someone was working on a solution for
sitemesh issues -

http://issues.apache.org/jira/browse/WW-3296

But, I haven't seen a patch yet. Anyhow, I don't know sitemesh well
enough to say whether using SiteMeshFilter will fix your problem, but
give it a try. If you provide a sample app, I'll try to get it fixed
for the next release.

-Wes

On Mon, Mar 15, 2010 at 1:19 PM, jonathan doklovic
 wrote:
 

All of the code is listed in the stackoverflow question.

I'm using:

Struts 2.1.8.1
Struts-Sitemesh Plugin 2.1.8.1
Sitemesh 2.4.2
Freemarker 2.3.15

Currently, I just have a single index.action that returns index.jsp 
which is

decorated with a single main.ftl file.

The jsp just has the simplest html structur with a string in the body.
The ftl decorator just adds a string and tries to spit out the body 
of the

jsp.

my struts.xml is:


  
  
  
  /index.jsp
  
  


my web.xml filters are:


  struts-prepare

org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter 


  

  
  sitemesh

org.apache.struts2.sitemesh.FreeMarkerPageFilter 


  

  
  struts2

org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter 


  

  
  struts-prepare
  /*
  

  
  sitemesh
  /*
  REQUEST
  FORWARD
  INCLUDE
  

  
  struts2
  /*
  




Wes Wannemacher wrote:
   

We'll probably need a little more info. In particular, I'd like to
know is which versions of struts, sitemesh and freemarker you are
using. Also, how do you have the various filters configured in your
struts.xml. Also, are you decorating freemarker results with
freemarker decorators?

-Wes

On Mon, Mar 15, 2010 at 12:05 PM, jonathan doklovic
 wrote:

 

I've been working for a week now trying to get Struts2 + Sitemesh +
Freemarker to work.
I've followed many tutorials and read docs but I still can't get 
it to

work.

Basically the decorator runs, but none of the variables get put into
scope
and so I get literal ${body}, ${title} and ${head} printed out.

You can find full details with my source in my stack overflow 
question:


http://stackoverflow.com/questions/2420752/struts2-sitemesh-freemarker-doesnt-work 



Can anyone help???

Thanks,

- Jonathan

-
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: Cannot find bean: "sendJsp" in any scope

2010-03-16 Thread tesla

When i add logic present tag to data.jsp i am not getting an error but my
page is still empty i think my arraylist is null but why? i'm waiting your
advices

tesla wrote:
> 
> Hi
> I wanna show my arrayList on the screen by using logic:iterate tag but
> when i run my application i am gettig this error.I'm working on this
> application for two days and still i cant see my arraylist elements on the
> browser.
> Thanks in advice.
> 
>  data.jsp
> 
> 
> 
>   
> 
> Book.java
> 
> public class Book {
> 
> private String name;
> private String description;
> private int price;
> private int id;
> 
> public Book()
>{
>
>}
> public Book(String name)
> {
> this.name=name;
> }
> 
>  public ArrayList loadData()
>  {
>  ArrayList kitapListesi = new ArrayList();
>  kitapListesi.add(new Book("calculus1"));
>   kitapListesi.add(new Book("calculus2"));
>  return kitapListesi;
>  }
> 
> BookAction.java
> 
>   public ActionForward execute(ActionMapping mapping, ActionForm form,
> HttpServletRequest request, HttpServletResponse response)
> throws Exception {
> 
> 
> BookForm bookForm = (BookForm) form;
> Book book = new Book();
> bookForm.setBookList(book.loadData());
>request.setAttribute("sendJsp", bookForm.getBookList());
> return mapping.findForward(SUCCESS);
> }
> 
> BookForm.Java
> 
> public class BookForm extends org.apache.struts.action.ActionForm {
> 
>  private ArrayList bookList = new ArrayList();
> 
> public BookForm() {
> super();
> // TODO Auto-generated constructor stub
> }
> public ArrayList getBookList() {  return bookList; }
>   public void setBookList(ArrayList bookList) {  this.bookList =
> bookList; }
> 
> struts_config.xml
> 
> >
> 
>   type="paket.BookAction" >
>   
>   
> 

-- 
View this message in context: 
http://old.nabble.com/Cannot-find-bean%3A-%22sendJsp%22-in-any-scope-tp27915481p27918564.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



property and expressions

2010-03-16 Thread CRANFORD, CHRIS
In Struts 2.1.6 I was able to write something like:



I was able to even include the attribute value's value in a s:checkbox
onclick attribute and it rendered just fine; however after upgrading to
Struts 2.1.8.1, these statements no longer work as they had prior.

Is there a more accepted way to write:



Thanks in advance.
Chris



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



[S2] Error running under Weblogic 10.3.2.0

2010-03-16 Thread Gustavo Felisberto
I am trying to run a Struts 2 application (basically the blank app). And I
get an error. Can someone give me a hand?

 

<16/Mar/2010 10H52m GMT> 

  <[ACTIVE] ExecuteThread: '9' for queue:
'weblogic.kernel.Default (self-tuning)'> <> <> <> <1268736734488>
  

<16/Mar/2010 10H52m GMT> 
  
<[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default
(self-tuning)'> <> <> <> <1268736734599>   

<16/Mar/2010 10H52m GMT>
<[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default
(self-tuning)'> <> <> <> <1268736734602>   

<16/Mar/2010 10H52m GMT>
<[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default
(self-tuning)'> <> <> <> <1268736735510>  

 

-- 

Gustavo Felisberto.

WIT-Software S.A.

Coimbra (Portugal), San Jose (California)

Phone: +351239801030

Web:   http://www.wit-software.com 

 



Cannot find bean: "sendJsp" in any scope

2010-03-16 Thread tesla

Hi
I wanna show my arrayList on the screen by using logic:iterate tag but when
i run my application i am gettig this error.I'm working on this application
for two days and still i cant see my arraylist elements on the browser.
Thanks in advice.

 data.jsp



  

Book.java

public class Book {

private String name;
private String description;
private int price;
private int id;

public Book()
   {
   
   }
public Book(String name)
{
this.name=name;
}

 public ArrayList loadData()
 {
 ArrayList kitapListesi = new ArrayList();
 kitapListesi.add(new Book("calculus1"));
  kitapListesi.add(new Book("calculus2"));
 return kitapListesi;
 }

BookAction.java

  public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {


BookForm bookForm = (BookForm) form;
Book book = new Book();
bookForm.setBookList(book.loadData());
   request.setAttribute("sendJsp", bookForm.getBookList());
return mapping.findForward(SUCCESS);
}

BookForm.Java

public class BookForm extends org.apache.struts.action.ActionForm {

 private ArrayList bookList = new ArrayList();

public BookForm() {
super();
// TODO Auto-generated constructor stub
}
public ArrayList getBookList() {  return bookList; }
  public void setBookList(ArrayList bookList) {  this.bookList =
bookList; }

struts_config.xml

>

 
  
  
-- 
View this message in context: 
http://old.nabble.com/Cannot-find-bean%3A-%22sendJsp%22-in-any-scope-tp27915481p27915481.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