help?

2006-11-17 Thread Mallik

Hi friends
this is my situation:
here i am going do app for a college, there may be any no of colleges and
each college may have any no of blocks.
i have a jsp where i display all the details of blocks in row wise(this is a
view block details page) and there will be some provision to modify any row(
means that block details).
>From there i transfer to blocksModify page in which she can modify any
details.
Problem is:
My modify blocks form has some text boxes and some select bokes 
i am getting the text box values,but for the select box the all ready
assiged college name should display from the rest of the options . i am not
getting this

i am using the same form bean for both listing college details in select box
and displaying the rest of the details

this is my modify antion class
---
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws Exception
{
String id = request.getParameter("id");
if(id==null)
return mapping.findForward("accessDenied");
String query = null;
BlocksForm block = null;
try
{
ds = getDataSource(request);
conn = ds.getConnection();
stmt = conn.createStatement();
}catch(SQLException e)
{
e.printStackTrace();
return mapping.findForward("sqlException");
}

try
{
query = "SELECT COLLEGEID,SHORTDESCRIPTION FROM 
COLLEGES";
rs = stmt.executeQuery(query);
colleges = new ArrayList();
if(rs.next())
{
do
{   
block =  new BlocksForm();

block.setCollege(rs.getString("COLLEGEID"));

block.setCollegeShortDesc(rs.getString("SHORTDESCRIPTION"));
colleges.add(block);
}while(rs.next());
}
request.getSession().setAttribute("COLLEGES",colleges);
query = "SELECT UNIQUE BLOCKID, SHORTDESCRIPTION, 
DESCRIPTION, ADDRESS,
PHONE, COLLEGEID FROM BLOCKS WHERE BLOCKID='"+id+"' ORDER BY
SHORTDESCRIPTION";
rs = stmt.executeQuery(query);
blocks = new ArrayList();

if(rs.next())
{
block = new BlocksForm();
block.setId(rs.getString("BLOCKID"));

block.setShortDesc(rs.getString("SHORTDESCRIPTION"));
block.setDesc(rs.getString("DESCRIPTION"));
block.setLocation(rs.getString("ADDRESS"));
block.setPhoneNo(rs.getString("PHONE"));
block.setCollege(rs.getString("COLLEGEID"));
blocks.add(block);

}else
{
return mapping.findForward("noCollegeSetup");
}
}catch(Exception e)
{
e.printStackTrace();
return mapping.findForward("exception");
}finally
{
if(conn!=null)
conn.close();
}
request.getSession().setAttribute("BLOCKS", blocks);
return mapping.findForward("continue");

}
-
this is my modify jsp page
-











   

Re: Indexed Properties

2006-11-17 Thread Adam K

Thanks for the suggestion I'll keep trying things and see what I can get
from it.


On 11/17/06, Hubert Rabago <[EMAIL PROTECTED]> wrote:


Lots of people have done it.  Search the archives [1]. Search for
"indexed" and "lazyList".   I've done it with both ActionForm and
DynaActionForm.

Hubert

[1] http://struts.apache.org/mail.html

On 11/17/06, Adam K <[EMAIL PROTECTED]> wrote:
> I think I have found the problem - or at least a potential cause.  Would
it
> be correct in stating that this will not work using ActionForm (what I
was
> using)  and that I must instead use DynaActionForm ?
>
> Thanks for the time thus far.
>
>
> On 11/17/06, Hubert Rabago <[EMAIL PROTECTED]> wrote:
> >
> > Adam,
> >
> > Try adding a getResultsPage() that doesn't take params and always
> > returns a valid collection.  (Throw in the setResultsPage() that
> > accepts a collection as well.)
> >
> > Hubert
> >
> > On 11/17/06, Adam K <[EMAIL PROTECTED]> wrote:
> > > This has been driving me nuts for the past little bit.
> > > I have a page that is populated using indexed properties.  The
> > prepopulation
> > > works  fine, and I get the results as I would expect them, but
trying to
> > > submit the form I get an index out of bounds exception.  I know that
it
> > is
> > > being caused because the page doesn't have the arrayList to use in
the
> > > indexed properties.   I guess my question boils down to using
indexed
> > > properties properly.  I will start by putting in an explanation of
what
> > I
> > > have and what I am trying to do:
> > >
> > > The following is what I am working with :
> > > JSP:
> > >
> > > 
> > >  > > id="ResultsPage">
> > > 
> > >  > property="description"
> > > />
> > >  > property="numProducts"
> > > indexed="true" /> 
> > > 
> > > 
> > > 
> > >
> > > What I am trying to achieve is that a user clicks on a link, they
are
> > sent
> > > to page, and all of the values are prepopulated.  The page is then
> > displayed
> > > and the user has the option to modify any of the variables that they
> > want to
> > > before resubmitting the page.  (When they resubmit the form has a
url
> > > parameter attached to it).  What is happening (or at least what I
> > believe is
> > > happening is the following:  link is clicked, reset is called action
> > sets
> > > the variables, page is displayed, user can modify the page and
resubmit,
> > > reset is called on the form, the action is called (this is where it
dies
> > as
> > > there is no longer an ArrayList) to modify.  My question is am I
going
> > about
> > > this in a manner that seems sensible or am I way off base ?  I have
the
> > > values being prepopulated, but when trying to use the values that
the
> > user
> > > puts in I can't use them in the action, nor can I pull the values
from
> > the
> > > form without again setting the values in the form.   I am hoping it
is
> > that
> > > I have over looked something, but it's possible that I don't
understand
> > > something as well.
> > >
> > > Here is the Action code (This is the entire execute method) :
> > > HttpSession session = request.getSession();
> > > ProdSelectionForm prodSelection = (ProdSelectionForm) form;
> > > User user ;
> > > user = (User)session.getAttribute("User");
> > > Order order = new Order();
> > > ArrayList products = new ArrayList();
> > > ArrayList pageRes = new ArrayList();
> > > ArrayList results = new ArrayList();
> > >
> > > String action = (request.getParameter("Dest") == null ?
> > "populate" :
> > > request.getParameter("Dest")   );
> > >
> > > order = user.getCurrOrder(user);
> > >
> > > if(action.equals("populate"))
> > > {
> > > prodSelection.setResults(order.getProducts());
> > > }
> > >
> > > if(action.equals("Delete"))
> > > {
> > > ArrayList p = new ArrayList();
> > > p = prodSelection.getResults();
> > >
> > > int count = 0;
> > > while (count < p.size())
> > > {
> > > Product t  = (Product) p.get(count);
> > > t.setDescription("" +t.getNumProducts() +">"
> > +pageRes.size()
> > > +"<");
> > > p.set(count, t);
> > > count++;
> > > }
> > >
> > > t.setDescription("" +t.getNumProducts() +">" +p.size()
> > +"<");
> > > p.set(0, t);
> > >
> > > user.setOrder(p , user);
> > > prodSelection.setResults(p);
> > > prodSelection.setTest(prodSelection.getTest()+" + " +
p.size
> > ());
> > >
> > > return mapping.findForward("success");
> > > }
> > > return mapping.findForward("success");
> > >
> > >
> > >
> > >
> > > Form code: (In the form code is an ArrayList called results.  This
> > arraylist
> > > contains  a bunch of Product )
> > >
> > > public Product getResultsPage(

log4j problem, need solution

2006-11-17 Thread Sreenivas M

I am getting the following message in tomcat console properties

info:log4j: Warn no appenders could be found for loggers(
org.apache.catalina.session.ManagerBase).
info: log4j:WARN Please initialize the log4j system property.

I am using Tomcat 5.1, and running a struts application. can any one find
out the solution for the problem.
Regards,
M.Sreenivas


Re: Indexed Properties

2006-11-17 Thread Hubert Rabago

Lots of people have done it.  Search the archives [1]. Search for
"indexed" and "lazyList".   I've done it with both ActionForm and
DynaActionForm.

Hubert

[1] http://struts.apache.org/mail.html

On 11/17/06, Adam K <[EMAIL PROTECTED]> wrote:

I think I have found the problem - or at least a potential cause.  Would it
be correct in stating that this will not work using ActionForm (what I was
using)  and that I must instead use DynaActionForm ?

Thanks for the time thus far.


On 11/17/06, Hubert Rabago <[EMAIL PROTECTED]> wrote:
>
> Adam,
>
> Try adding a getResultsPage() that doesn't take params and always
> returns a valid collection.  (Throw in the setResultsPage() that
> accepts a collection as well.)
>
> Hubert
>
> On 11/17/06, Adam K <[EMAIL PROTECTED]> wrote:
> > This has been driving me nuts for the past little bit.
> > I have a page that is populated using indexed properties.  The
> prepopulation
> > works  fine, and I get the results as I would expect them, but trying to
> > submit the form I get an index out of bounds exception.  I know that it
> is
> > being caused because the page doesn't have the arrayList to use in the
> > indexed properties.   I guess my question boils down to using indexed
> > properties properly.  I will start by putting in an explanation of what
> I
> > have and what I am trying to do:
> >
> > The following is what I am working with :
> > JSP:
> >
> > 
> >  > id="ResultsPage">
> > 
> >  property="description"
> > />
> >  property="numProducts"
> > indexed="true" /> 
> > 
> > 
> > 
> >
> > What I am trying to achieve is that a user clicks on a link, they are
> sent
> > to page, and all of the values are prepopulated.  The page is then
> displayed
> > and the user has the option to modify any of the variables that they
> want to
> > before resubmitting the page.  (When they resubmit the form has a url
> > parameter attached to it).  What is happening (or at least what I
> believe is
> > happening is the following:  link is clicked, reset is called action
> sets
> > the variables, page is displayed, user can modify the page and resubmit,
> > reset is called on the form, the action is called (this is where it dies
> as
> > there is no longer an ArrayList) to modify.  My question is am I going
> about
> > this in a manner that seems sensible or am I way off base ?  I have the
> > values being prepopulated, but when trying to use the values that the
> user
> > puts in I can't use them in the action, nor can I pull the values from
> the
> > form without again setting the values in the form.   I am hoping it is
> that
> > I have over looked something, but it's possible that I don't understand
> > something as well.
> >
> > Here is the Action code (This is the entire execute method) :
> > HttpSession session = request.getSession();
> > ProdSelectionForm prodSelection = (ProdSelectionForm) form;
> > User user ;
> > user = (User)session.getAttribute("User");
> > Order order = new Order();
> > ArrayList products = new ArrayList();
> > ArrayList pageRes = new ArrayList();
> > ArrayList results = new ArrayList();
> >
> > String action = (request.getParameter("Dest") == null ?
> "populate" :
> > request.getParameter("Dest")   );
> >
> > order = user.getCurrOrder(user);
> >
> > if(action.equals("populate"))
> > {
> > prodSelection.setResults(order.getProducts());
> > }
> >
> > if(action.equals("Delete"))
> > {
> > ArrayList p = new ArrayList();
> > p = prodSelection.getResults();
> >
> > int count = 0;
> > while (count < p.size())
> > {
> > Product t  = (Product) p.get(count);
> > t.setDescription("" +t.getNumProducts() +">"
> +pageRes.size()
> > +"<");
> > p.set(count, t);
> > count++;
> > }
> >
> > t.setDescription("" +t.getNumProducts() +">" +p.size()
> +"<");
> > p.set(0, t);
> >
> > user.setOrder(p , user);
> > prodSelection.setResults(p);
> > prodSelection.setTest(prodSelection.getTest()+" + " + p.size
> ());
> >
> > return mapping.findForward("success");
> > }
> > return mapping.findForward("success");
> >
> >
> >
> >
> > Form code: (In the form code is an ArrayList called results.  This
> arraylist
> > contains  a bunch of Product )
> >
> > public Product getResultsPage(int index)
> > {
> > if(this.results == null)
> > {
> > this.results = new ArrayList();
> > }
> >
> > while(index >= this.results.size())
> > {
> > this.results.add(new Product());
> > }
> > return (Product) results.get(index);
> > }
> >
> > public void setResultsPage(int index, Product p)
> > {
> >  

Re: Indexed Properties

2006-11-17 Thread Adam K

I think I have found the problem - or at least a potential cause.  Would it
be correct in stating that this will not work using ActionForm (what I was
using)  and that I must instead use DynaActionForm ?

Thanks for the time thus far.


On 11/17/06, Hubert Rabago <[EMAIL PROTECTED]> wrote:


Adam,

Try adding a getResultsPage() that doesn't take params and always
returns a valid collection.  (Throw in the setResultsPage() that
accepts a collection as well.)

Hubert

On 11/17/06, Adam K <[EMAIL PROTECTED]> wrote:
> This has been driving me nuts for the past little bit.
> I have a page that is populated using indexed properties.  The
prepopulation
> works  fine, and I get the results as I would expect them, but trying to
> submit the form I get an index out of bounds exception.  I know that it
is
> being caused because the page doesn't have the arrayList to use in the
> indexed properties.   I guess my question boils down to using indexed
> properties properly.  I will start by putting in an explanation of what
I
> have and what I am trying to do:
>
> The following is what I am working with :
> JSP:
>
> 
>  id="ResultsPage">
> 
>  />
>  indexed="true" /> 
> 
> 
> 
>
> What I am trying to achieve is that a user clicks on a link, they are
sent
> to page, and all of the values are prepopulated.  The page is then
displayed
> and the user has the option to modify any of the variables that they
want to
> before resubmitting the page.  (When they resubmit the form has a url
> parameter attached to it).  What is happening (or at least what I
believe is
> happening is the following:  link is clicked, reset is called action
sets
> the variables, page is displayed, user can modify the page and resubmit,
> reset is called on the form, the action is called (this is where it dies
as
> there is no longer an ArrayList) to modify.  My question is am I going
about
> this in a manner that seems sensible or am I way off base ?  I have the
> values being prepopulated, but when trying to use the values that the
user
> puts in I can't use them in the action, nor can I pull the values from
the
> form without again setting the values in the form.   I am hoping it is
that
> I have over looked something, but it's possible that I don't understand
> something as well.
>
> Here is the Action code (This is the entire execute method) :
> HttpSession session = request.getSession();
> ProdSelectionForm prodSelection = (ProdSelectionForm) form;
> User user ;
> user = (User)session.getAttribute("User");
> Order order = new Order();
> ArrayList products = new ArrayList();
> ArrayList pageRes = new ArrayList();
> ArrayList results = new ArrayList();
>
> String action = (request.getParameter("Dest") == null ?
"populate" :
> request.getParameter("Dest")   );
>
> order = user.getCurrOrder(user);
>
> if(action.equals("populate"))
> {
> prodSelection.setResults(order.getProducts());
> }
>
> if(action.equals("Delete"))
> {
> ArrayList p = new ArrayList();
> p = prodSelection.getResults();
>
> int count = 0;
> while (count < p.size())
> {
> Product t  = (Product) p.get(count);
> t.setDescription("" +t.getNumProducts() +">"
+pageRes.size()
> +"<");
> p.set(count, t);
> count++;
> }
>
> t.setDescription("" +t.getNumProducts() +">" +p.size()
+"<");
> p.set(0, t);
>
> user.setOrder(p , user);
> prodSelection.setResults(p);
> prodSelection.setTest(prodSelection.getTest()+" + " + p.size
());
>
> return mapping.findForward("success");
> }
> return mapping.findForward("success");
>
>
>
>
> Form code: (In the form code is an ArrayList called results.  This
arraylist
> contains  a bunch of Product )
>
> public Product getResultsPage(int index)
> {
> if(this.results == null)
> {
> this.results = new ArrayList();
> }
>
> while(index >= this.results.size())
> {
> this.results.add(new Product());
> }
> return (Product) results.get(index);
> }
>
> public void setResultsPage(int index, Product p)
> {
> if(this.results == null)
> {
> this.results = new ArrayList();
> }
>
> while(index >= this.results.size())
> {
> this.results.add(new Product());
> }
> results.set(index, p);
> //return (Product) results.get(index);
> }
>
> public void setResults(ArrayList results)
> {
>this.results=results;
> }
>
> public ArrayList getResults()
> {
>return this.results;
> }
>
>
>
> Products is an object that stores various things about a product

Re: Indexed Properties

2006-11-17 Thread Hubert Rabago

Adam,

Try adding a getResultsPage() that doesn't take params and always
returns a valid collection.  (Throw in the setResultsPage() that
accepts a collection as well.)

Hubert

On 11/17/06, Adam K <[EMAIL PROTECTED]> wrote:

This has been driving me nuts for the past little bit.
I have a page that is populated using indexed properties.  The prepopulation
works  fine, and I get the results as I would expect them, but trying to
submit the form I get an index out of bounds exception.  I know that it is
being caused because the page doesn't have the arrayList to use in the
indexed properties.   I guess my question boils down to using indexed
properties properly.  I will start by putting in an explanation of what I
have and what I am trying to do:

The following is what I am working with :
JSP:





 




What I am trying to achieve is that a user clicks on a link, they are sent
to page, and all of the values are prepopulated.  The page is then displayed
and the user has the option to modify any of the variables that they want to
before resubmitting the page.  (When they resubmit the form has a url
parameter attached to it).  What is happening (or at least what I believe is
happening is the following:  link is clicked, reset is called action sets
the variables, page is displayed, user can modify the page and resubmit,
reset is called on the form, the action is called (this is where it dies as
there is no longer an ArrayList) to modify.  My question is am I going about
this in a manner that seems sensible or am I way off base ?  I have the
values being prepopulated, but when trying to use the values that the user
puts in I can't use them in the action, nor can I pull the values from the
form without again setting the values in the form.   I am hoping it is that
I have over looked something, but it's possible that I don't understand
something as well.

Here is the Action code (This is the entire execute method) :
HttpSession session = request.getSession();
ProdSelectionForm prodSelection = (ProdSelectionForm) form;
User user ;
user = (User)session.getAttribute("User");
Order order = new Order();
ArrayList products = new ArrayList();
ArrayList pageRes = new ArrayList();
ArrayList results = new ArrayList();

String action = (request.getParameter("Dest") == null ? "populate" :
request.getParameter("Dest")   );

order = user.getCurrOrder(user);

if(action.equals("populate"))
{
prodSelection.setResults(order.getProducts());
}

if(action.equals("Delete"))
{
ArrayList p = new ArrayList();
p = prodSelection.getResults();

int count = 0;
while (count < p.size())
{
Product t  = (Product) p.get(count);
t.setDescription("" +t.getNumProducts() +">" +pageRes.size()
+"<");
p.set(count, t);
count++;
}

t.setDescription("" +t.getNumProducts() +">" +p.size() +"<");
p.set(0, t);

user.setOrder(p , user);
prodSelection.setResults(p);
prodSelection.setTest(prodSelection.getTest()+" + " + p.size());

return mapping.findForward("success");
}
return mapping.findForward("success");




Form code: (In the form code is an ArrayList called results.  This arraylist
contains  a bunch of Product )

public Product getResultsPage(int index)
{
if(this.results == null)
{
this.results = new ArrayList();
}

while(index >= this.results.size())
{
this.results.add(new Product());
}
return (Product) results.get(index);
}

public void setResultsPage(int index, Product p)
{
if(this.results == null)
{
this.results = new ArrayList();
}

while(index >= this.results.size())
{
this.results.add(new Product());
}
results.set(index, p);
//return (Product) results.get(index);
}

public void setResults(ArrayList results)
{
   this.results=results;
}

public ArrayList getResults()
{
   return this.results;
}



Products is an object that stores various things about a product with
numProducts, and description being two of those things.
Within Products is both getter and setter methods for the numProducts as
well as description.



Thanks so much for any help you may be able to provide.




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



LazySortedMap of LazyList Objects in a Form

2006-11-17 Thread Eric Benedetti
I've got a Form which contains a LazySortedMap, the keys being Strings 
and the values being LazyList objects.  Each LazyList object contains a 
list of Checkbox objects (basically just like LabelValueBean objects).  
In the jsp, I would like to iterate through the sorted map, and for each 
LazyList, iterate through that printing out the Checkbox values.  I 
cannot get this working !  Anyone know how I can write my jsp so that 
each checkbox value is something like group(keyname).checked[index] ?  
Help is much appreciated!


I've tried in the jsp something like:


   type="java.lang.String"/>
   indexId="i">   
   <% String cbprop = "group(" + thiskey + ")[" + i + 
"].checked"; %>

   
  
   


I've got the form defined:

   protected Map groups = MapUtils.lazySortedMap(
   new TreeMap(), 
new Factory() {
   public 
Object create() {
   return 
buildGroup();

   }
   });


   public Map getGroups() {
   return groups;
   }

   public void setGroups(final TreeMap newGroups) {
   groups = MapUtils.lazySortedMap(newGroups, new Factory() {
   public Object create() {
   return buildGroup();
   }
   });
   }   


   private List buildGroup() {
   List checkboxes = ListUtils.lazyList(new java.util.ArrayList(), 
new Factory() {

   public Object create() {
   return new Checkbox();
   }
   });
  
   return checkboxes;
   }  


   public void setGroup(String key, Object value) {
   getGroups().put(key,value);
   }
   public Object getGroup(String key) {
   return getGroups().get(key);
   } 



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



RE: Indexed Properties

2006-11-17 Thread Juan Espinosa
Hi to all i have two questions...

First question... is possible to remove spring dependecies in struts2 or
spring stuff (jars,  applicationContext.xml and ContextLoadListener)  are
neccesary to run struts2 

Second question or advise... i want to give a try to ajax, i want some parts
of me site to be updated without reloading the whole page, for example. I
need some advise where to start, struts2 ajax support, etc...

well thats all, thanks for helping me.


Regards,

Juan Espinosa


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



Indexed Properties

2006-11-17 Thread Adam K

This has been driving me nuts for the past little bit.
I have a page that is populated using indexed properties.  The prepopulation
works  fine, and I get the results as I would expect them, but trying to
submit the form I get an index out of bounds exception.  I know that it is
being caused because the page doesn't have the arrayList to use in the
indexed properties.   I guess my question boils down to using indexed
properties properly.  I will start by putting in an explanation of what I
have and what I am trying to do:

The following is what I am working with :
JSP:


   
   
   

   
   


What I am trying to achieve is that a user clicks on a link, they are sent
to page, and all of the values are prepopulated.  The page is then displayed
and the user has the option to modify any of the variables that they want to
before resubmitting the page.  (When they resubmit the form has a url
parameter attached to it).  What is happening (or at least what I believe is
happening is the following:  link is clicked, reset is called action sets
the variables, page is displayed, user can modify the page and resubmit,
reset is called on the form, the action is called (this is where it dies as
there is no longer an ArrayList) to modify.  My question is am I going about
this in a manner that seems sensible or am I way off base ?  I have the
values being prepopulated, but when trying to use the values that the user
puts in I can't use them in the action, nor can I pull the values from the
form without again setting the values in the form.   I am hoping it is that
I have over looked something, but it's possible that I don't understand
something as well.

Here is the Action code (This is the entire execute method) :
   HttpSession session = request.getSession();
   ProdSelectionForm prodSelection = (ProdSelectionForm) form;
   User user ;
   user = (User)session.getAttribute("User");
   Order order = new Order();
   ArrayList products = new ArrayList();
   ArrayList pageRes = new ArrayList();
   ArrayList results = new ArrayList();

   String action = (request.getParameter("Dest") == null ? "populate" :
request.getParameter("Dest")   );

   order = user.getCurrOrder(user);

   if(action.equals("populate"))
   {
   prodSelection.setResults(order.getProducts());
   }

   if(action.equals("Delete"))
   {
   ArrayList p = new ArrayList();
   p = prodSelection.getResults();

   int count = 0;
   while (count < p.size())
   {
   Product t  = (Product) p.get(count);
   t.setDescription("" +t.getNumProducts() +">" +pageRes.size()
+"<");
   p.set(count, t);
   count++;
   }

   t.setDescription("" +t.getNumProducts() +">" +p.size() +"<");
   p.set(0, t);

   user.setOrder(p , user);
   prodSelection.setResults(p);
   prodSelection.setTest(prodSelection.getTest()+" + " + p.size());

   return mapping.findForward("success");
   }
   return mapping.findForward("success");




Form code: (In the form code is an ArrayList called results.  This arraylist
contains  a bunch of Product )

   public Product getResultsPage(int index)
   {
   if(this.results == null)
   {
   this.results = new ArrayList();
   }

   while(index >= this.results.size())
   {
   this.results.add(new Product());
   }
   return (Product) results.get(index);
   }

   public void setResultsPage(int index, Product p)
   {
   if(this.results == null)
   {
   this.results = new ArrayList();
   }

   while(index >= this.results.size())
   {
   this.results.add(new Product());
   }
   results.set(index, p);
   //return (Product) results.get(index);
   }

   public void setResults(ArrayList results)
   {
  this.results=results;
   }

   public ArrayList getResults()
   {
  return this.results;
   }



Products is an object that stores various things about a product with
numProducts, and description being two of those things.
Within Products is both getter and setter methods for the numProducts as
well as description.



Thanks so much for any help you may be able to provide.


Re: [s2] mvn archetype

2006-11-17 Thread Martin Gainty
Good Morning All-

executing 
http://www.planetstruts.org/struts2-showcase/ajax/remoteforms/ and locally
http://localhost:8080/struts2-showcase-2.0.1/ajax/remoteforms/
click on 1st button (Remote form replacing another div)
I see 
Struts Problem Report
Struts has detected an unhandled exception: 

  Messages: There is no Action mapped for action name 
ajax/remoteforms/AjaxRemoteForm.  




Stacktraces
There is no Action mapped for action name ajax/remoteforms/AjaxRemoteForm. - 
[unknown location] 

in /struts-2.0.1/apps/struts2-showcase-2.0.1/WEB-INF/classes/struts-ajax.xml I 
see
http://struts.apache.org/dtds/struts-2.0.dtd";>




/ajax/AjaxResult.jsp



/ajax/AjaxResult2.js



/ajax/AjaxResult3.jsp




/ajax/AjaxResult3.jsp


apparently by specifying an (Action) class for ajax/remoteforms/AjaxRemoteForm 
I was able to resolve the no Action Mapped 

Does this look right?
Martin--
This e-mail communication and any attachments may contain confidential and 
privileged information for the use of the 
designated recipients named above. If you are not the intended recipient, you 
are hereby notified that you have received
this communication in error and that any review, disclosure, dissemination, 
distribution or copying of it or its 
contents
- Original Message - 
From: "Mark Menard" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" 
Sent: Thursday, November 16, 2006 11:08 PM
Subject: Re: [s2] mvn archetype


> On 11/16/06 11:03 PM, "Wendy Smoak" <[EMAIL PROTECTED]> wrote:
> 
>> On 11/16/06, Mark Menard <[EMAIL PROTECTED]> wrote:
>> 
>>> I've tried to set up a new project using the struts2 mvn archetype, but to
>>> no avail.
>> 
>> What did you type?
> 
> mvn archetype:create -DgroupId=tutorial -DartifactId=tutorial
> -DarchetypeGroupId=net.vitarara.dan
> -DarchetypeArtifactId=struts2-archetype-starter
> -DarchetypeVersion=2.0.2-SNAPSHOT
> 
> 
>>> Where can I get the archetype file? I've downloaded and built the latest
>>> snapshot using svn and mvn.
>> 
>> If you've built the archetype locally, the version number is 2.0.2-SNAPSHOT .
> 
> I've checked out and done a mvn -Pall on the latest struts2 from svn.
> Wouldn't that have the archetype in it?
> 
>> In case you only checked out and built the framework,  the archetype is here:
>>  
>> http://svn.apache.org/repos/asf/struts/maven/trunk/struts2-archetype-starter/
> 
> I'm totally new to mvn, being an ant guy, how would I tell mvn to go get it
> there?
> 
> Thanks,
> 
> Mark
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

[s2] Message resources from database

2006-11-17 Thread Nate Drake
Hi,

We're in the process of migrating a Struts1 app to Struts2.  In Struts1 we
created a subclass of PropertyMessageResources to get our messages from the
database instead of properties files.  I can't seem to find how we'd go about
doing this in Struts2.  Do I just subclass
com.opensymphony.xwork.util.LocalizedTextUtil and configure the 
framework to use it?

Thanks!

Nate


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



Re: can not reach the jsp file

2006-11-17 Thread Ed Griebel

Does Welcome.do work correctly? I would first try to get that working
because then you will know that your jsp's are in the correct
directory and you are calling the do from the correct directory.

If Welcome.do doesn't work, check out:
- check that you have defined that *.do is mapped to Struts servlet in
your web.xml file. There should be a  section which
references org.apache.struts.action.ActionServlet and
/WEB-INF/struts-config.xml, and a  that maps *.do to
the action servlet.
- check that your URL is to the correct path, e.g. if you deploy in
test.war and your app server is on your machine listening on 8080,
your url should be http://localhost:8080/test/Welcome.do and that
should bring up your JSP

If those are set up right, then:
- You want to be able to tell where the problem is, if your action is
not being called, or if it's not forwarding to your JSP
- put some kind of logging (or a breakpoint if debugging) in your
action to verify that your action class is being executed
- print out the mapping you get (mapping.findForward()) to make sure
that it exists and you haven't made a typo, and see what JSP it's
going to forward to.
- You have probably already done this, but make your jsp very simple,
just  "hello" will do

HTH,
-ed

On 11/16/06, Ken Hu <[EMAIL PROTECTED]> wrote:

Dear All:

I'm doing a simple strus test, but all I can see after I try to visit
"ShowDocs.do" is a blank page.

struts-config.xml:







My Action class:
public ActionForward execute(ActionMapping mapping,
ActionForm form,
ServletRequest request,
ServletResponse response)
throws Exception{
return mapping.findForward("success");
}

I can not find anything wrong , could someone please tell me what's
going on here ?

Thanks
--
研發部 胡重威 Ken Hu  [EMAIL PROTECTED]

孟華科技股份有限公司
http://www.mmti.com.tw

地址: 高雄市802苓雅區中正一路120號4F-7
電話: 07-7279337 分機: 120
傳真: 07-7279377
行動: 0937083880


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




Asish Thomas/IM/FPL is out of the office.

2006-11-17 Thread Asish_Thomas

I will be out of the office starting  11/17/2006 and will not return until
11/20/2006.

Please contact Mahesh Bhat for any OCS related queries.


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



RE: can not reach the jsp file

2006-11-17 Thread Lance Semmens
scrap that idea... I was being a stupid head. cdms is your context path which 
it ok.

-Original Message-
From: Lance Semmens [mailto:[EMAIL PROTECTED] 
Sent: 17 November 2006 13:01
To: 'Struts Users Mailing List'
Subject: RE: can not reach the jsp file

> The URL that I ask my browser to browse is:
> http://localhost:8080/cdms/ShowDocs.do

Try hitting http://localhost:8080/ShowDocs.do
Or change your action mapping to
mailto:[EMAIL PROTECTED] 
Sent: 17 November 2006 10:40
To: Struts Users Mailing List
Subject: RE: can not reach the jsp file

No , I am using firefox.
I can see no exception or warning in log file(tomcat's log).
My platform is Tomcat 5.5 on Debian Linux, I develope and test my code
in Netbeans IDE.

Ken

於 五,2006-11-17 於 10:22 +,Lance Semmens 提到:
> hmm... are you using IE?
> You may need to turn off "show friendly error messages" in the options 
> somewhere. I'm thinking you've got a server error that IE is hiding from you. 
> Any errors in the log?
> 
>  -Original Message-
> From: Ken Hu [mailto:[EMAIL PROTECTED] 
> Sent: 17 November 2006 01:39
> To: Struts Users Mailing List
> Subject: RE: can not reach the jsp file
> 
> well ... sorry for that , this is a wrong typing when I post this
> question.
> In my struts-config.xml , the slash is not missing.
> 
> I add log4J in my app to trace my code :
> 
> public class ShowDocsAct extends org.apache.struts.action.Action{
> private Category _cat = Category.getInstance(this.getClass());
> public ActionForward execute(ActionMapping mapping,
> ActionForm form,
> ServletRequest request,
> ServletResponse response)
> throws Exception{
> 
>//print out this line in log file to prove the process has come
> into this class
> _cat.info("come into Action");
> 
> return mapping.findForward("success");
> }
> }
> 
> But I can not find the evidence that the process has come into this
> Action class.
> My struts-config.xml is as following :
> 
> 
> 
>  type="com.kenhu.cdms.servlet.ShowDocsAct">
> 
> 
>  
> 
> The URL that I ask my browser to browse is :
> http://localhost:8080/cdms/ShowDocs.do
> 
> Help  !  what do I go wrong ?
> 
> Ken
> 
> 
> 於 四,2006-11-16 於 15:16 +,Lance Semmens 提到:
> > I think you're missing a '/'
> > 
> > 
> > To keep your webapp a bit cleaner, perhaps consider
> > 
> > 
> > -Original Message-
> > From: Ken Hu [mailto:[EMAIL PROTECTED] 
> > Sent: 16 November 2006 09:03
> > To: user@struts.apache.org
> > Subject: can not reach the jsp file
> > 
> > Dear All:
> > 
> > I'm doing a simple strus test, but all I can see after I try to visit
> > "ShowDocs.do" is a blank page.
> > 
> > struts-config.xml:
> > 
> > 
> >  > type="com.kenhu.cdms.servlet.ShowDocsAct">
> > 
> > 
> > 
> > 
> > My Action class:
> > public ActionForward execute(ActionMapping mapping,
> > ActionForm form,
> > ServletRequest request,
> > ServletResponse response)
> > throws Exception{
> > return mapping.findForward("success");
> > }
> > 
> > I can not find anything wrong , could someone please tell me what's
> > going on here ?
> > 
> > Thanks
-- 
研發部 胡重威 Ken Hu  [EMAIL PROTECTED]

孟華科技股份有限公司
http://www.mmti.com.tw

地址: 高雄市802苓雅區中正一路120號4F-7
電話: 07-7279337 分機: 120
傳真: 07-7279377
行動: 0937083880


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




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




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



RE: can not reach the jsp file

2006-11-17 Thread Lance Semmens
> The URL that I ask my browser to browse is:
> http://localhost:8080/cdms/ShowDocs.do

Try hitting http://localhost:8080/ShowDocs.do
Or change your action mapping to
mailto:[EMAIL PROTECTED] 
Sent: 17 November 2006 10:40
To: Struts Users Mailing List
Subject: RE: can not reach the jsp file

No , I am using firefox.
I can see no exception or warning in log file(tomcat's log).
My platform is Tomcat 5.5 on Debian Linux, I develope and test my code
in Netbeans IDE.

Ken

於 五,2006-11-17 於 10:22 +,Lance Semmens 提到:
> hmm... are you using IE?
> You may need to turn off "show friendly error messages" in the options 
> somewhere. I'm thinking you've got a server error that IE is hiding from you. 
> Any errors in the log?
> 
>  -Original Message-
> From: Ken Hu [mailto:[EMAIL PROTECTED] 
> Sent: 17 November 2006 01:39
> To: Struts Users Mailing List
> Subject: RE: can not reach the jsp file
> 
> well ... sorry for that , this is a wrong typing when I post this
> question.
> In my struts-config.xml , the slash is not missing.
> 
> I add log4J in my app to trace my code :
> 
> public class ShowDocsAct extends org.apache.struts.action.Action{
> private Category _cat = Category.getInstance(this.getClass());
> public ActionForward execute(ActionMapping mapping,
> ActionForm form,
> ServletRequest request,
> ServletResponse response)
> throws Exception{
> 
>//print out this line in log file to prove the process has come
> into this class
> _cat.info("come into Action");
> 
> return mapping.findForward("success");
> }
> }
> 
> But I can not find the evidence that the process has come into this
> Action class.
> My struts-config.xml is as following :
> 
> 
> 
>  type="com.kenhu.cdms.servlet.ShowDocsAct">
> 
> 
>  
> 
> The URL that I ask my browser to browse is :
> http://localhost:8080/cdms/ShowDocs.do
> 
> Help  !  what do I go wrong ?
> 
> Ken
> 
> 
> 於 四,2006-11-16 於 15:16 +,Lance Semmens 提到:
> > I think you're missing a '/'
> > 
> > 
> > To keep your webapp a bit cleaner, perhaps consider
> > 
> > 
> > -Original Message-
> > From: Ken Hu [mailto:[EMAIL PROTECTED] 
> > Sent: 16 November 2006 09:03
> > To: user@struts.apache.org
> > Subject: can not reach the jsp file
> > 
> > Dear All:
> > 
> > I'm doing a simple strus test, but all I can see after I try to visit
> > "ShowDocs.do" is a blank page.
> > 
> > struts-config.xml:
> > 
> > 
> >  > type="com.kenhu.cdms.servlet.ShowDocsAct">
> > 
> > 
> > 
> > 
> > My Action class:
> > public ActionForward execute(ActionMapping mapping,
> > ActionForm form,
> > ServletRequest request,
> > ServletResponse response)
> > throws Exception{
> > return mapping.findForward("success");
> > }
> > 
> > I can not find anything wrong , could someone please tell me what's
> > going on here ?
> > 
> > Thanks
-- 
研發部 胡重威 Ken Hu  [EMAIL PROTECTED]

孟華科技股份有限公司
http://www.mmti.com.tw

地址: 高雄市802苓雅區中正一路120號4F-7
電話: 07-7279337 分機: 120
傳真: 07-7279377
行動: 0937083880


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




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



Re: can not reach the jsp file

2006-11-17 Thread WongTseng

You can check your source code of the blank page to see if there is 
and  tags in it. If there are,that may be because the forward you use
is missing or incorrect.

2006/11/17, Ken Hu <[EMAIL PROTECTED]>:


No , I am using firefox.
I can see no exception or warning in log file(tomcat's log).
My platform is Tomcat 5.5 on Debian Linux, I develope and test my code
in Netbeans IDE.

Ken

於 五,2006-11-17 於 10:22 +,Lance Semmens 提到:
> hmm... are you using IE?
> You may need to turn off "show friendly error messages" in the options
somewhere. I'm thinking you've got a server error that IE is hiding from
you. Any errors in the log?
>
>  -Original Message-
> From: Ken Hu [mailto:[EMAIL PROTECTED]
> Sent: 17 November 2006 01:39
> To: Struts Users Mailing List
> Subject: RE: can not reach the jsp file
>
> well ... sorry for that , this is a wrong typing when I post this
> question.
> In my struts-config.xml , the slash is not missing.
>
> I add log4J in my app to trace my code :
>
> public class ShowDocsAct extends org.apache.struts.action.Action{
> private Category _cat = Category.getInstance(this.getClass());
> public ActionForward execute(ActionMapping mapping,
> ActionForm form,
> ServletRequest request,
> ServletResponse response)
> throws Exception{
>
>//print out this line in log file to prove the process has come
> into this class
> _cat.info("come into Action");
>
> return mapping.findForward("success");
> }
> }
>
> But I can not find the evidence that the process has come into this
> Action class.
> My struts-config.xml is as following :
>
> 
> 
>  type="com.kenhu.cdms.servlet.ShowDocsAct">
> 
> 
>  
>
> The URL that I ask my browser to browse is :
> http://localhost:8080/cdms/ShowDocs.do
>
> Help  !  what do I go wrong ?
>
> Ken
>
>
> 於 四,2006-11-16 於 15:16 +,Lance Semmens 提到:
> > I think you're missing a '/'
> > 
> >
> > To keep your webapp a bit cleaner, perhaps consider
> > 
> >
> > -Original Message-
> > From: Ken Hu [mailto:[EMAIL PROTECTED]
> > Sent: 16 November 2006 09:03
> > To: user@struts.apache.org
> > Subject: can not reach the jsp file
> >
> > Dear All:
> >
> > I'm doing a simple strus test, but all I can see after I try to visit
> > "ShowDocs.do" is a blank page.
> >
> > struts-config.xml:
> > 
> > 
> >  > type="com.kenhu.cdms.servlet.ShowDocsAct">
> > 
> > 
> > 
> >
> > My Action class:
> > public ActionForward execute(ActionMapping mapping,
> > ActionForm form,
> > ServletRequest request,
> > ServletResponse response)
> > throws Exception{
> > return mapping.findForward("success");
> > }
> >
> > I can not find anything wrong , could someone please tell me what's
> > going on here ?
> >
> > Thanks
--
研�l部 胡重威 Ken Hu  [EMAIL PROTECTED]

孟�A科技股份有限公司
http://www.mmti.com.tw

地址: 高雄市802苓雅�^中正一路120��4F-7
: 07-7279337 分�C: 120
�髡�: 07-7279377
行��: 0937083880


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





--
Wong Tseng
王曾


Asish Thomas/IM/FPL is out of the office.

2006-11-17 Thread Asish_Thomas

I will be out of the office starting  11/17/2006 and will not return until
11/20/2006.

Please contact Mahesh Bhat for any OCS related queries.


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



RE: can not reach the jsp file

2006-11-17 Thread Ken Hu
No , I am using firefox.
I can see no exception or warning in log file(tomcat's log).
My platform is Tomcat 5.5 on Debian Linux, I develope and test my code
in Netbeans IDE.

Ken

於 五,2006-11-17 於 10:22 +,Lance Semmens 提到:
> hmm... are you using IE?
> You may need to turn off "show friendly error messages" in the options 
> somewhere. I'm thinking you've got a server error that IE is hiding from you. 
> Any errors in the log?
> 
>  -Original Message-
> From: Ken Hu [mailto:[EMAIL PROTECTED] 
> Sent: 17 November 2006 01:39
> To: Struts Users Mailing List
> Subject: RE: can not reach the jsp file
> 
> well ... sorry for that , this is a wrong typing when I post this
> question.
> In my struts-config.xml , the slash is not missing.
> 
> I add log4J in my app to trace my code :
> 
> public class ShowDocsAct extends org.apache.struts.action.Action{
> private Category _cat = Category.getInstance(this.getClass());
> public ActionForward execute(ActionMapping mapping,
> ActionForm form,
> ServletRequest request,
> ServletResponse response)
> throws Exception{
> 
>//print out this line in log file to prove the process has come
> into this class
> _cat.info("come into Action");
> 
> return mapping.findForward("success");
> }
> }
> 
> But I can not find the evidence that the process has come into this
> Action class.
> My struts-config.xml is as following :
> 
> 
> 
>  type="com.kenhu.cdms.servlet.ShowDocsAct">
> 
> 
>  
> 
> The URL that I ask my browser to browse is :
> http://localhost:8080/cdms/ShowDocs.do
> 
> Help  !  what do I go wrong ?
> 
> Ken
> 
> 
> 於 四,2006-11-16 於 15:16 +,Lance Semmens 提到:
> > I think you're missing a '/'
> > 
> > 
> > To keep your webapp a bit cleaner, perhaps consider
> > 
> > 
> > -Original Message-
> > From: Ken Hu [mailto:[EMAIL PROTECTED] 
> > Sent: 16 November 2006 09:03
> > To: user@struts.apache.org
> > Subject: can not reach the jsp file
> > 
> > Dear All:
> > 
> > I'm doing a simple strus test, but all I can see after I try to visit
> > "ShowDocs.do" is a blank page.
> > 
> > struts-config.xml:
> > 
> > 
> >  > type="com.kenhu.cdms.servlet.ShowDocsAct">
> > 
> > 
> > 
> > 
> > My Action class:
> > public ActionForward execute(ActionMapping mapping,
> > ActionForm form,
> > ServletRequest request,
> > ServletResponse response)
> > throws Exception{
> > return mapping.findForward("success");
> > }
> > 
> > I can not find anything wrong , could someone please tell me what's
> > going on here ?
> > 
> > Thanks
-- 
研發部 胡重威 Ken Hu  [EMAIL PROTECTED]

孟華科技股份有限公司
http://www.mmti.com.tw

地址: 高雄市802苓雅區中正一路120號4F-7
電話: 07-7279337 分機: 120
傳真: 07-7279377
行動: 0937083880


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



RE: can not reach the jsp file

2006-11-17 Thread Lance Semmens
hmm... are you using IE?
You may need to turn off "show friendly error messages" in the options 
somewhere. I'm thinking you've got a server error that IE is hiding from you. 
Any errors in the log?

 -Original Message-
From: Ken Hu [mailto:[EMAIL PROTECTED] 
Sent: 17 November 2006 01:39
To: Struts Users Mailing List
Subject: RE: can not reach the jsp file

well ... sorry for that , this is a wrong typing when I post this
question.
In my struts-config.xml , the slash is not missing.

I add log4J in my app to trace my code :

public class ShowDocsAct extends org.apache.struts.action.Action{
private Category _cat = Category.getInstance(this.getClass());
public ActionForward execute(ActionMapping mapping,
ActionForm form,
ServletRequest request,
ServletResponse response)
throws Exception{

   //print out this line in log file to prove the process has come
into this class
_cat.info("come into Action");

return mapping.findForward("success");
}
}

But I can not find the evidence that the process has come into this
Action class.
My struts-config.xml is as following :






 

The URL that I ask my browser to browse is :
http://localhost:8080/cdms/ShowDocs.do

Help  !  what do I go wrong ?

Ken


於 四,2006-11-16 於 15:16 +,Lance Semmens 提到:
> I think you're missing a '/'
> 
> 
> To keep your webapp a bit cleaner, perhaps consider
> 
> 
> -Original Message-
> From: Ken Hu [mailto:[EMAIL PROTECTED] 
> Sent: 16 November 2006 09:03
> To: user@struts.apache.org
> Subject: can not reach the jsp file
> 
> Dear All:
> 
> I'm doing a simple strus test, but all I can see after I try to visit
> "ShowDocs.do" is a blank page.
> 
> struts-config.xml:
> 
> 
>  type="com.kenhu.cdms.servlet.ShowDocsAct">
> 
> 
> 
> 
> My Action class:
> public ActionForward execute(ActionMapping mapping,
> ActionForm form,
> ServletRequest request,
> ServletResponse response)
> throws Exception{
> return mapping.findForward("success");
> }
> 
> I can not find anything wrong , could someone please tell me what's
> going on here ?
> 
> Thanks
-- 
研發部 胡重威 Ken Hu  [EMAIL PROTECTED]

孟華科技股份有限公司
http://www.mmti.com.tw

地址: 高雄市802苓雅區中正一路120號4F-7
電話: 07-7279337 分機: 120
傳真: 07-7279377
行動: 0937083880


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




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



RE: custom tag for localization

2006-11-17 Thread Lance Semmens
Not exactly what you asked for but LocaleAction can set the locale then 
redirect to a page.

http://struts.apache.org/1.x/struts-extras/apidocs/

-Original Message-
From: Mahmoud Saeed(RSW) [mailto:[EMAIL PROTECTED] 
Sent: 14 November 2006 23:30
To: user@struts.apache.org
Subject: custom tag for localization

 

Hi, 

I want an open-source custom tag for localizing struts-based application
using dispatch Action.

thanx




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



RE: Logging in Struts

2006-11-17 Thread Thomas Joseph
Hi Cab,

As far as my experience, use Logger using log4j and use static declaration.
There should not be any problems for your application.

I think you are not writing a library application, that will be shared by
other applications running on your server. So go ahead with the efficient
way!



Thanks and Regards,
Thomas Joseph

Kott Software Pvt. Ltd. | Vallamattom Estate | M.G.Road | Cochin | Kerala -
682015 | India
www.kottsoftware.com
  _

This email (including any attachments) is subject to copyright, the
information in it is confidential, and it is legally privileged. Use of this
email or of any information in it other than by the addressee is
unauthorized and unlawful. If you are not the intended recipient of the
mail, kindly notify the author of the mail and delete the same.



-Original Message-
From: Mon Cab [mailto:[EMAIL PROTECTED]
Sent: Friday, November 17, 2006 2:19 AM
To: Struts User Group
Subject: Logging in Struts



Good day

I am having a hard time understanding how to use logging in Struts.
The struts.apache.org suggest the following usage (presumably for
business objects) (taken from:


However, I am wondering whether this is OK, given that my business
objects will be being accessed from different servlet threads.  Can
anyone tell me whether this is OK?, and if not, what is the correct way
to do this?

My second question is whether the same usage is valid for Action
classes. I saw the following example, at
http://www.mobilefish.com/developer/struts/struts_quickguide_log4j.html
but am not certain as to whether using a static variable would be OK
here.  Would it?

public class DemoAction extends Action {

  private static Log log =
LogFactory.getLog("com.mobilefish.DemoAction");

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

 log.debug("This is my debug message.");
 log.info("This is my info message.");
 log.warn("This is my warn message.");
 log.error("This is my error message.");
 log.fatal("This is my fatal message.");

  }
}

The commons logging documentation notes the following:

Note that for application code, declaring the log member as "static" is
more efficient as one Log object is created per class, and is
recommended. However this is not safe to do for a class which may be
deployed via a "shared" classloader in a servlet or j2ee container or
similar environment. If the class may end up invoked with different
thread-context-classloader values set then the member must not be
declared static. The use of "static" should therefore be avoided in
code within any "library" type project.

I'm not clear as to what the above means, from a practical perspective
in the context of a web applicaiton.  What does this mean in simple
terms?

Taken from:
http://jakarta.apache.org/commons/logging/guide.html#Configuring_Log4J








The all-new Yahoo! Mail beta
Fire up a more powerful email and get things done faster.
http://new.mail.yahoo.com


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




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



RE: RE: RE: [HELP] struts 1.2.9 multibox/checkbox in session scoped form

2006-11-17 Thread Lance Semmens
RequestProcessor is doing it's job by resetting the form. What should then 
happen is that your checkboxes should be set after reset() is called which 
doesn't seem to be happening.

Somethings not right here, esp since when you comment out reset, it works. Can 
you post your code? pls. include the relevant parts of struts-config.xml, your 
action and your form.

-Original Message-
From: Garner Shawn [mailto:[EMAIL PROTECTED] 
Sent: 14 November 2006 17:36
To: user@struts.apache.org
Subject: RE: RE: RE: [HELP] struts 1.2.9 multibox/checkbox in session scoped 
form

I am not explicitly calling the reset anywhere.
I've also debugged it and can not find anything out of the ordinary.
>From I can tell it is the request processor that is resetting my form
prior to the page displaying that ends up with the checkboxes not
checked.

Any help?


Shawn

--
From: Lance Semmens <[EMAIL PROTECTED]>
To: 'Struts Users Mailing List' 
Date: Tue, 14 Nov 2006 09:51:00 +
Subject: RE: RE: [HELP] struts 1.2.9 multibox/checkbox in session scoped form
The only thing I can think is maybe you're explicitly calling reset()
in your action (instead of letting struts do it automatically). If
not, I suggest putting a debug breakpoint on the setters for your
checkboxes and see what's going on.

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




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



Asish Thomas/IM/FPL is out of the office.

2006-11-17 Thread Asish_Thomas

I will be out of the office starting  11/17/2006 and will not return until
11/20/2006.

Please contact Mahesh Bhat for any OCS related queries.


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