Mail Messages Using JavaMail in Struts

2003-12-06 Thread Caroline Jen
Has a Struts application been built to handle
send/view personal mail messages using JavaMail?

If the answer is "yes", please provide information how
to contact the developer of the application.

__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

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



Re: Config help

2003-12-06 Thread jeichels
In the first line:  Without validation, the form does show it prepopulated

was really meant to say:  Without validation, the form does NOT show it prepopulated

- Original Message -
From: [EMAIL PROTECTED]
Date: Sunday, December 7, 2003 1:05 am
Subject: Config help

> 
> I am using MappingDispatchAction and am attempting to pre-populate 
> a DynaValidatorForm in a setup action. Without validation, the 
> form does show it prepopulated, but upon enterring data, it gets 
> into my submit action.  With Validation it does validate in my 
> submit action and returns errors which I print out.   The data 
> again reaches my submit and past my validate, but fails to show 
> back in the redisplayed form in error.
> 
> I have looked through the forums and docs and know it has been 
> covered.  I am seeking an extra eye because I can't seem to figure 
> out what is going wrong.   If you don't mind can you take a quick 
> look.  I have tried many variations and think it is something 
> simple I am doing wrong.
> 
> Thank you for any help.  Below are my details.
> 
> John
> 
> 
> 
> 
> Tools:  Post Struts 1.1, Velocity FormTool (updated to work with 
> post struts 1.1).
> 
> 
> 
> Inside my setup action:
> 
>// @Test place a piece of data into the form and see if it 
> comes out other side.
>DynaValidatorForm form = (DynaValidatorForm)baseForm;
>form.set(CtlConstants.FORM_TITLE, "Test Title Data");
>request.setAttribute(mapping.getName(), form);
>return mapping.findForward("editpage");
>
>
>
> Inside my submit action:
> 
>   DynaValidatorForm form = (DynaValidatorForm)baseForm;
>   ActionMessages errors = new ActionMessages();
>   errors = form.validate(mapping, request);
>   // form values show up here, but not in returned form.
>   if (! errors.isEmpty())
>{
>this.saveErrors(request, errors);
>request.setAttribute(mapping.getName(), form);
>return new ActionForward(mapping.getInput());
>}
> 
>
> Inside my struts-config.xml:
> 
>
> type="com.jb.controller.services.jobpost.wizard.Step1Action"   
> parameter="setupPage"
>name="/exec/post/wizard/page1/submit/form"
>validate="false"
>scope="request">
>redirect="false"
>path="/WEB-
> INF/templates/exec/post/wizard/wizardstep1.vm"/>
> redirect="false"
>path="/action/pub/systemError" />
>
>
>
>
> type="com.jb.controller.services.post.wizard.Step1Action"  
>  parameter="submitPage"
>name="/exec/jobpost/wizard/page1/submit/form"
>input="/WEB-
> INF/templates/exec/post/wizard/wizardstep1.vm"
> validate="false"scope="request">
>redirect="false"
>path="/WEB-
> INF/templates/exec/post/wizard/wizardstep1.vm"/>
> redirect="false"
>path="/action/exec/post/wizard/page2/setup"/>
>redirect="false"
>path="/action/pub/systemError" />
>
> 
> 
> ---
> --
> 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]



Config help

2003-12-06 Thread jeichels

I am using MappingDispatchAction and am attempting to pre-populate a DynaValidatorForm 
in a setup action. Without validation, the form does show it prepopulated, but upon 
enterring data, it gets into my submit action.  With Validation it does validate in my 
submit action and returns errors which I print out.   The data again reaches my submit 
and past my validate, but fails to show back in the redisplayed form in error.

I have looked through the forums and docs and know it has been covered.  I am seeking 
an extra eye because I can't seem to figure out what is going wrong.   If you don't 
mind can you take a quick look.  I have tried many variations and think it is 
something simple I am doing wrong.

Thank you for any help.  Below are my details.

John




Tools:  Post Struts 1.1, Velocity FormTool (updated to work with post struts 1.1).



Inside my setup action:

// @Test place a piece of data into the form and see if it comes out other 
side.
DynaValidatorForm form = (DynaValidatorForm)baseForm;
form.set(CtlConstants.FORM_TITLE, "Test Title Data");
request.setAttribute(mapping.getName(), form);
return mapping.findForward("editpage");



Inside my submit action:

   DynaValidatorForm form = (DynaValidatorForm)baseForm;
   ActionMessages errors = new ActionMessages();
   errors = form.validate(mapping, request);
   // form values show up here, but not in returned form.
   if (! errors.isEmpty())
{
this.saveErrors(request, errors);
request.setAttribute(mapping.getName(), form);
return new ActionForward(mapping.getInput());
}


Inside my struts-config.xml:














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



from Action to Facade: simple attributes or Business Objects

2003-12-06 Thread Felipe Nascimento
Hi,

I was wondering what do experts recommend:

inside Action´s execute method we should pass the attributes to the Facade
or create the business objects in the Action and pass them on?

1)
execute(){
 Facade.addUser(name, surname, login, birth, );
}

or

2)
execute(){
 User u = new User();
 u.setName(name);
 u.setSurname(surname);
 ..others setters.
 Facade.addUser(u);
}

Tks
Felipe



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



RE: Very Troubled in Finding Ways to Pass a Variable to a Class

2003-12-06 Thread Caroline Jen
It is wonderful to know that there are some ActionForm
methods that holds true in the
scaffold.ProcessAction's execute() method.  It gives
the hope that my problem could be resolved.  

Via a submit button in my JSP, I try to pass two
variables; username and keyName, to my Java class
(FindEditorData.java) with the
type="org.apache.struts.scaffold.ProcessAction", and
this Java class has this method:

   public Object execute() throws Exception { ... }

1. if I use the hidden field technique (see below)
inside the JSP  tag:
<% String username = request.getRemoteUser();%>



How do I retrieve the value of username and keyName in
the Java class?  Probably due to my lack of knowledge
of the ActionForm, I got compilation error "cannot
resolve symbol: request" or "cannot resolve symbol:
session" because FindEditorData.java does not extend
HttpServlet and FindEditorData.java does not extend
Action.

2. if I want to get 'username' in the Java class
instead of passing the 'username' as a hidden field
from a submit button in my JSP, how do I do it?

String username = request.getRemoteUser(); gives me a
compilation error "cannot resolve symbol: request".  

The action mapping in my struts-config.xml looks like:

   


-Caroline
--- Joe Hertz <[EMAIL PROTECTED]> wrote:
> Actually, you haven't illustrated it. You've just
> stated it.
> 
> In the ActionForm there are methods like validate()
> that accept as
> parameters an ActionMapping and an
> httpServletRequest, and from the
> httpServletRequest you can call getSession().
> 
> Same holds true in the Action class' execute()
> method.
> 
> So what is the problem with your class? Why can't
> you utilize it from
> one of these places that you do have access to these
> things? What
> exactly is stopping you here? Once you tell us, then
> you will have
> illustrated the problem.
> 
> -J
> 
> > -Original Message-
> > From: Caroline Jen [mailto:[EMAIL PROTECTED] 
> > Sent: Saturday, December 06, 2003 1:47 PM
> > To: Struts Users Mailing List
> > Subject: Re: Very Troubled in Finding Ways to Pass
> a Variable 
> > to a Class
> > 
> > 
> > I know how to pass a hidden field.  The problem is
> how
> > to retrieve it in my Java class.  I have
> illustrated
> > that my Java class does not extend HttpServlet or
> > Action.
> > 
> > This Java class has a mapping in the
> struts-config.xml
> > file:
> > 
> > type="org.apache.struts.scaffold.ProcessAction"
> > parameter="org.XYZ.article.FindEditorData"
> > name="articleForm"
> > 
> > -Caroline
> > --- Timo <[EMAIL PROTECTED]> wrote:
> > > Caroline,
> > > The best way I use it to pass parameters to the
> > > action class is via a hidden
> > > attribute in the form, in your case the
> > > "articleForm"
> > > you can define the hidden attribute using
> > > 
> > >  > > value="<%=request.getRemoteUser();%>"/>
> > > Good luck.
> > > 
> > > - Original Message -
> > > From: "Caroline Jen" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Friday, December 05, 2003 8:17 PM
> > > Subject: Very Troubled in Finding Ways to Pass a
> > > Variable to a Class
> > > 
> > > 
> > > > I have a class FindEditorData.java.  I want to
> > > pass a
> > > > vairable 'username' to this class for some
> > > processing.
> > > >  This class is invoked from a JSP:
> > > >
> > > > 
> > > > View Articles
> > > >
> > > > and the value of the 'username' is obtained
> this
> > > way:
> > > >
> > > > String username = request.getRemoteUser();
> > > >
> > > > Due to my limited knowledge in Struts,  I
> cannot
> > > > figure out what to do.  Let me explain the
> > > problem:
> > > >
> > > > 1. This class has this method:
> > > >
> > > >public Object execute() throws Exception {
> ...
> > > }
> > > >
> > > >I do not make this class extends
> HttpServlet or
> > > > extends Action.  I cannot nest a method inside
> a 
> > doGet/doPost or the 
> > > > Action's excute().
> > > >
> > > > 2. The action mapping in the struts-config.xml
> is
> > > this
> > > > way:
> > > >  > > > roles="editor"
> > > > path="/find/Category"
> > > >
> > > >
> type="org.apache.struts.scaffold.ProcessAction"
> > > >
> parameter="org.XYZ.article.FindEditorData"
> > > > name="articleForm"
> > > > validate="false">
> > > > > > > name="success"
> > > > path=".article.Result"/>
> > > > 
> > > >
> > > > I am stuck because I do not know how to pass
> > > > 'username' to the FindEditorData.java.  I
> cannot
> > > > state:
> > > >
> > > >String username = request.getRemoteUser();
> > > >or
> > > >String username =
> (String)session.getAttribute( "EditorName" );
> > > >
> > > >because the FindEditorData is not a servlet
> and
> > > > does not extend Action.
> > > >
> > > > I cannot pass a hidden variable from the JSP
> > > because I
> > > > do not know how to retrieve the value of a
> hidden
> > > > variable in a Java class.
> > > >
> > > > Need clever ideas.  

Link-to-action?

2003-12-06 Thread Theodosios Paschalidis
Hi all,

I am a new struts user utilizing it for my uni project. I have reached a point that I 
do not know how to handle "the struts way" and am really stuck! I spent a lot time on 
this and I would be grateful for any further info!

 I am dynamically producing some search results. I will be turning them into links and 
I want to pass a parameter.

Is it possible that a user clicking on a link can trigger an action? eg having 
something like 

Using JSPs would be easy to do invoking the appropriate method directly the above way.

Using servlets I could just do String itemId=request.getParameter("Itemid").
Since an ActionClass is a servlet could I achieve the same using the Form as a 
transfer object for the ID property?

If this cannot be done using the struts sequence (Form-Action) then maybe it will be 
easier forwarding to a JSP? Doing that though will require me using a scriptlet to 
retrieve the object of interest :( Any better way? (because my Items are nested I am 
trying to do it through an Action)

In a nutshell: 1) I display a collection
   2) I want to somehow select the item that the user clicked, for 
detailed description

Any help will be really appreciated!
Thank you for your time,
Theo





RE: Very Troubled in Finding Ways to Pass a Variable to a Class

2003-12-06 Thread Joe Hertz
Actually, you haven't illustrated it. You've just stated it.

In the ActionForm there are methods like validate() that accept as
parameters an ActionMapping and an httpServletRequest, and from the
httpServletRequest you can call getSession().

Same holds true in the Action class' execute() method.

So what is the problem with your class? Why can't you utilize it from
one of these places that you do have access to these things? What
exactly is stopping you here? Once you tell us, then you will have
illustrated the problem.

-J

Apologies if this goes out more than once. I'm having mail weirdness

> -Original Message-
> From: Caroline Jen [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, December 06, 2003 1:47 PM
> To: Struts Users Mailing List
> Subject: Re: Very Troubled in Finding Ways to Pass a Variable 
> to a Class
> 
> 
> I know how to pass a hidden field.  The problem is how
> to retrieve it in my Java class.  I have illustrated
> that my Java class does not extend HttpServlet or
> Action.
> 
> This Java class has a mapping in the struts-config.xml
> file:
> 
> type="org.apache.struts.scaffold.ProcessAction"
> parameter="org.XYZ.article.FindEditorData"
> name="articleForm"
> 
> -Caroline
> --- Timo <[EMAIL PROTECTED]> wrote:
> > Caroline,
> > The best way I use it to pass parameters to the
> > action class is via a hidden
> > attribute in the form, in your case the
> > "articleForm"
> > you can define the hidden attribute using
> > 
> >  > value="<%=request.getRemoteUser();%>"/>
> > Good luck.
> > 
> > - Original Message -
> > From: "Caroline Jen" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Friday, December 05, 2003 8:17 PM
> > Subject: Very Troubled in Finding Ways to Pass a
> > Variable to a Class
> > 
> > 
> > > I have a class FindEditorData.java.  I want to
> > pass a
> > > vairable 'username' to this class for some
> > processing.
> > >  This class is invoked from a JSP:
> > >
> > > 
> > > View Articles
> > >
> > > and the value of the 'username' is obtained this
> > way:
> > >
> > > String username = request.getRemoteUser();
> > >
> > > Due to my limited knowledge in Struts,  I cannot
> > > figure out what to do.  Let me explain the
> > problem:
> > >
> > > 1. This class has this method:
> > >
> > >public Object execute() throws Exception { ...
> > }
> > >
> > >I do not make this class extends HttpServlet or
> > > extends Action.  I cannot nest a method inside a 
> doGet/doPost or the 
> > > Action's excute().
> > >
> > > 2. The action mapping in the struts-config.xml is
> > this
> > > way:
> > >  > > roles="editor"
> > > path="/find/Category"
> > >
> > > type="org.apache.struts.scaffold.ProcessAction"
> > > parameter="org.XYZ.article.FindEditorData"
> > > name="articleForm"
> > > validate="false">
> > > > > name="success"
> > > path=".article.Result"/>
> > > 
> > >
> > > I am stuck because I do not know how to pass
> > > 'username' to the FindEditorData.java.  I cannot
> > > state:
> > >
> > >String username = request.getRemoteUser();
> > >or
> > >String username = (String)session.getAttribute( "EditorName" );
> > >
> > >because the FindEditorData is not a servlet and
> > > does not extend Action.
> > >
> > > I cannot pass a hidden variable from the JSP
> > because I
> > > do not know how to retrieve the value of a hidden
> > > variable in a Java class.
> > >
> > > Need clever ideas.  Please help.
> > >
> > >
> > >
> > >
> > > __
> > > Do you Yahoo!?
> > > New Yahoo! Photos - easier uploading and sharing. 
> > > http://photos.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]
> > 
> 
> 
> __
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing. 
http://photos.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: Tomcat 4.1.29 & Struts

2003-12-06 Thread David Friedman
Mukund,

What was your Tomcat 4.1.29 problem?  Was the wrong DTD part of the problem?

Regards,
David

-Original Message-
From: Mukund Ramadoss [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 04, 2003 7:06 PM
To: 'Struts Users Mailing List'
Subject: Tomcat 4.1.29 & Struts


Is anyone working with Struts on Tomcat 4.1.29?
If yes, can you provide me some inputs on the installation.

I'm getting org.apache.jasper.JasperException: Cannot find message
resources under key org.apache.struts.action.MESSAGE, when executing
 in the jsp.

Thanks
Mukund


-Original Message-
From: Mukund Ramadoss [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 04, 2003 9:00 AM
To: 'Struts Users Mailing List'
Subject: RE: org.apache.struts.action.MESSAGE


My attachment got denied.
I'm enclosing it here. Thanks - Mukund
- struts-config.xml

http://jakarta.apache.org/struts/dtds/struts-config_1.0.dtd";>
 
  
- web.xml


http://java.sun.com/dtd/web-app_2_3.dtd";>



  
action

org.apache.struts.action.ActionServlet

  application
  


  config
  /WEB-INF/struts-config.xml


  debug
  2


  detail
  2


  validate
  true


   application
   

2
  

  
  
action
/do/*
  
  
invoker
/servlet/*
  
  
  
index.jsp
index.html
  



   
/WEB-INF/struts-bean.tld
   
   
/WEB-INF/struts-bean.tld
   


   
/WEB-INF/struts-html.tld
   
   
/WEB-INF/struts-html.tld
   


   
/WEB-INF/struts-logic.tld
   
   
/WEB-INF/struts-logic.tld
   


   
/WEB-INF/struts-template.tld
   
   
/WEB-INF/struts-template.tld
   
 





-

-Original Message-
From: Mukund Ramadoss [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 04, 2003 8:55 AM
To: 'Struts Users Mailing List'
Subject: org.apache.struts.action.MESSAGE


Hi,

I'm setting up Struts to work with Tomcat 4.1.29.

When I tried to run a jsp (BookView.jsp) from a tutorial, I get the
following exception :
org.apache.jasper.JasperException: Cannot find message resources under
key org.apache.struts.action.MESSAGE
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:254)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)


I'm attaching struts-config.xml, web.xml, and BookView.jsp for your
reference.

I've tried copying ApplicationResources.properties from classes to
WEB-INF folder. But the result is same.
Any suggestions?

Thanks
Mukund


-
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: Very Troubled in Finding Ways to Pass a Variable to a Class

2003-12-06 Thread Joe Hertz
Actually, you haven't illustrated it. You've just stated it.

In the ActionForm there are methods like validate() that accept as
parameters an ActionMapping and an httpServletRequest, and from the
httpServletRequest you can call getSession().

Same holds true in the Action class' execute() method.

So what is the problem with your class? Why can't you utilize it from
one of these places that you do have access to these things? What
exactly is stopping you here? Once you tell us, then you will have
illustrated the problem.

-J

> -Original Message-
> From: Caroline Jen [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, December 06, 2003 1:47 PM
> To: Struts Users Mailing List
> Subject: Re: Very Troubled in Finding Ways to Pass a Variable 
> to a Class
> 
> 
> I know how to pass a hidden field.  The problem is how
> to retrieve it in my Java class.  I have illustrated
> that my Java class does not extend HttpServlet or
> Action.
> 
> This Java class has a mapping in the struts-config.xml
> file:
> 
> type="org.apache.struts.scaffold.ProcessAction"
> parameter="org.XYZ.article.FindEditorData"
> name="articleForm"
> 
> -Caroline
> --- Timo <[EMAIL PROTECTED]> wrote:
> > Caroline,
> > The best way I use it to pass parameters to the
> > action class is via a hidden
> > attribute in the form, in your case the
> > "articleForm"
> > you can define the hidden attribute using
> > 
> >  > value="<%=request.getRemoteUser();%>"/>
> > Good luck.
> > 
> > - Original Message -
> > From: "Caroline Jen" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Friday, December 05, 2003 8:17 PM
> > Subject: Very Troubled in Finding Ways to Pass a
> > Variable to a Class
> > 
> > 
> > > I have a class FindEditorData.java.  I want to
> > pass a
> > > vairable 'username' to this class for some
> > processing.
> > >  This class is invoked from a JSP:
> > >
> > > 
> > > View Articles
> > >
> > > and the value of the 'username' is obtained this
> > way:
> > >
> > > String username = request.getRemoteUser();
> > >
> > > Due to my limited knowledge in Struts,  I cannot
> > > figure out what to do.  Let me explain the
> > problem:
> > >
> > > 1. This class has this method:
> > >
> > >public Object execute() throws Exception { ...
> > }
> > >
> > >I do not make this class extends HttpServlet or
> > > extends Action.  I cannot nest a method inside a 
> doGet/doPost or the 
> > > Action's excute().
> > >
> > > 2. The action mapping in the struts-config.xml is
> > this
> > > way:
> > >  > > roles="editor"
> > > path="/find/Category"
> > >
> > > type="org.apache.struts.scaffold.ProcessAction"
> > > parameter="org.XYZ.article.FindEditorData"
> > > name="articleForm"
> > > validate="false">
> > > > > name="success"
> > > path=".article.Result"/>
> > > 
> > >
> > > I am stuck because I do not know how to pass
> > > 'username' to the FindEditorData.java.  I cannot
> > > state:
> > >
> > >String username = request.getRemoteUser();
> > >or
> > >String username = (String)session.getAttribute( "EditorName" );
> > >
> > >because the FindEditorData is not a servlet and
> > > does not extend Action.
> > >
> > > I cannot pass a hidden variable from the JSP
> > because I
> > > do not know how to retrieve the value of a hidden
> > > variable in a Java class.
> > >
> > > Need clever ideas.  Please help.
> > >
> > >
> > >
> > >
> > > __
> > > Do you Yahoo!?
> > > New Yahoo! Photos - easier uploading and sharing. 
> > > http://photos.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]
> > 
> 
> 
> __
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing. 
http://photos.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: [OT] Mailing large number of recipients

2003-12-06 Thread Craig R. McClanahan
Quoting Shyam A <[EMAIL PROTECTED]>:

> Kirk,
> 
> Thanks a lot for your suggestions. I will look into
> JMS.
> In my current approach, the process of sending the
> mail is time consuming.I'm concerned that sending an
> email to 1000's of recipients from my application
> (using JMS, Thread etc) would clog my application
> server (OC4J) and slow down its operation, which is
> why I was wondering if it could be done at the
> backend-Oracle 9i.
> 

Would it not be simpler to set up a mailing list application on your mail
server, so you only have to send the message to a single recipient address
(pretty much the way the struts-user mailing list works)?  This would also
relieve you of the burden of having to change your application every time the
list of recipients changs.

Craig


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



Re: Very Troubled in Finding Ways to Pass a Variable to a Class

2003-12-06 Thread Caroline Jen
I know how to pass a hidden field.  The problem is how
to retrieve it in my Java class.  I have illustrated
that my Java class does not extend HttpServlet or
Action.

This Java class has a mapping in the struts-config.xml
file:

type="org.apache.struts.scaffold.ProcessAction"
parameter="org.XYZ.article.FindEditorData"
name="articleForm"

-Caroline
--- Timo <[EMAIL PROTECTED]> wrote:
> Caroline,
> The best way I use it to pass parameters to the
> action class is via a hidden
> attribute in the form, in your case the
> "articleForm"
> you can define the hidden attribute using
> 
>  value="<%=request.getRemoteUser();%>"/>
> Good luck.
> 
> - Original Message - 
> From: "Caroline Jen" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, December 05, 2003 8:17 PM
> Subject: Very Troubled in Finding Ways to Pass a
> Variable to a Class
> 
> 
> > I have a class FindEditorData.java.  I want to
> pass a
> > vairable 'username' to this class for some
> processing.
> >  This class is invoked from a JSP:
> >
> > 
> > View Articles
> >
> > and the value of the 'username' is obtained this
> way:
> >
> > String username = request.getRemoteUser();
> >
> > Due to my limited knowledge in Struts,  I cannot
> > figure out what to do.  Let me explain the
> problem:
> >
> > 1. This class has this method:
> >
> >public Object execute() throws Exception { ...
> }
> >
> >I do not make this class extends HttpServlet or
> > extends Action.  I cannot nest a method inside a
> > doGet/doPost or the Action's excute().
> >
> > 2. The action mapping in the struts-config.xml is
> this
> > way:
> >  > roles="editor"
> > path="/find/Category"
> >
> > type="org.apache.struts.scaffold.ProcessAction"
> > parameter="org.XYZ.article.FindEditorData"
> > name="articleForm"
> > validate="false">
> > > name="success"
> > path=".article.Result"/>
> > 
> >
> > I am stuck because I do not know how to pass
> > 'username' to the FindEditorData.java.  I cannot
> > state:
> >
> >String username = request.getRemoteUser();
> >or
> >String username = (String)session.getAttribute(
> > "EditorName" );
> >
> >because the FindEditorData is not a servlet and
> > does not extend Action.
> >
> > I cannot pass a hidden variable from the JSP
> because I
> > do not know how to retrieve the value of a hidden
> > variable in a Java class.
> >
> > Need clever ideas.  Please help.
> >
> >
> >
> >
> > __
> > Do you Yahoo!?
> > New Yahoo! Photos - easier uploading and sharing.
> > http://photos.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]
> 


__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

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



Using Input Button inside a Iterate Tag

2003-12-06 Thread Shantanu Deo
What is the mechanics of using the Input button inside of the Iterate tag.


I have my JSP as



 
   Number
   First Name
   Last Name
   Telephone Count
 Address
 
 
  
 
 
 
 
 
 
  
 
 
  
 






What should my corresponding code in Action be to recognize which of the
delete/update buttons are clicked.

Thanks in advance
Shantanu



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



Re: session taglib

2003-12-06 Thread Suneel Kumar Kollukuduru


struts wrote:

In the Jsp i have:



witch prints the username. Now i want something like:

<%

String username= ;

%>

but that doesn't work. How can i assign the session variable to the String username ?

Thanks !



 



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


Re: Very Troubled in Finding Ways to Pass a Variable to a Class

2003-12-06 Thread Timo
Caroline,
The best way I use it to pass parameters to the action class is via a hidden
attribute in the form, in your case the "articleForm"
you can define the hidden attribute using


Good luck.

- Original Message - 
From: "Caroline Jen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 05, 2003 8:17 PM
Subject: Very Troubled in Finding Ways to Pass a Variable to a Class


> I have a class FindEditorData.java.  I want to pass a
> vairable 'username' to this class for some processing.
>  This class is invoked from a JSP:
>
> 
> View Articles
>
> and the value of the 'username' is obtained this way:
>
> String username = request.getRemoteUser();
>
> Due to my limited knowledge in Struts,  I cannot
> figure out what to do.  Let me explain the problem:
>
> 1. This class has this method:
>
>public Object execute() throws Exception { ... }
>
>I do not make this class extends HttpServlet or
> extends Action.  I cannot nest a method inside a
> doGet/doPost or the Action's excute().
>
> 2. The action mapping in the struts-config.xml is this
> way:
>  roles="editor"
> path="/find/Category"
>
> type="org.apache.struts.scaffold.ProcessAction"
> parameter="org.XYZ.article.FindEditorData"
> name="articleForm"
> validate="false">
> name="success"
> path=".article.Result"/>
> 
>
> I am stuck because I do not know how to pass
> 'username' to the FindEditorData.java.  I cannot
> state:
>
>String username = request.getRemoteUser();
>or
>String username = (String)session.getAttribute(
> "EditorName" );
>
>because the FindEditorData is not a servlet and
> does not extend Action.
>
> I cannot pass a hidden variable from the JSP because I
> do not know how to retrieve the value of a hidden
> variable in a Java class.
>
> Need clever ideas.  Please help.
>
>
>
>
> __
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing.
> http://photos.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: HELP: about to get datasource of struts and pass to logic beans...

2003-12-06 Thread Vic Cekvenich
Take a look at a very good db example app that uses Struts on iBatis.com
caled PetStore 3.

.V

Ricky wrote:
> hi, there, 
> 
> with my project i had several queries about get datasource in struts. i know how 
> to get datasource in struts, just as in myAction, use getDataSource method and 
> return DataSource object, and go on to get connection  
> 
> i also know the logic beans between the Controller and Module, so i create a 
> logic bean ,i don't know how to get datasourc of pass the datasource, in some 
> tutorial , i got a way to solve this, create a method getDAO(HttpServletRequest 
> request) and pass the request to the method to get DataSource, i was lost here, i 
> dont' know what should i return in getDAO, should i return a DataSource object or 
> others and in my logic bean i can use the datasource and also get connection , 
> statement and resultset object , there i have to close it after i finish my process 
> what do you think of this i did ? in general, when i got a DataSource, i will 
> got a connection from datasource and a PrepareStatement and also a ResultSet , when 
> i finished my process, i can close all object i opened before in final method of try 
> ...catch...experession.. now what should i do to return a proper object in getDAO 
> method and in logic beans i can use the object to process logic business...
> 
> i appologized for this ... i hope you can give me some suggestion or flow.. 
> thanx!
> 
> now here is my flow of struts framework to pass the datasource to the logic beans... 
>  i hope you can reword if you have some good idea...of correct my mistake... :)
> 
> myAction :
> 
> myAction extends Action() {
>   public ActionForward execute(ActionMapping mapping,
>ActionForm form,
>HttpServletRequest request,
>HttpServletResponse response) {
> LogicBean bean = new LogicBean();
> Object objcet = bean.doMethod(getDAO(request), other param)
>   }
>   
>   public DataSource getDAO(HttpServletRequest request) {
> DataSource ds = null;
> ds = getDataSource(request);
> return ds;
>   }
> }
> 
> and in my logic bean :
> 
> class LogicBean {
>   public Objct doMethod(DataSource ds, other param) {
> try {
>   Connection conn = ds.getConnection();
>   PrepareStatment stmt = conn.prepareStatment("SELECT ...");
>   stmt.setInt(1,);
>   ResultSet rs = stmt.executeQuery();
>   
>   return Object.;
> } catch (SQLException ex) {
>   ex.printStactTrace();
> } final {
>   try {
> rs.close();
> stmt.close();
> conn.close()
>   } catch (Exception ex) {
> ex.printStactTrace();
>   }
> }
> return null;
>   }
> }
> 
> should i pass the DataSource to my logic beans? otherwise what object should i 
> pass



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



RE: .do's come back as 404 file not found

2003-12-06 Thread ajay brar
hi!

i had the same problem with my tomcat, and this happened only on my online 
account and not on my home pc. The app worked fine earlier and then suddenly 
stopped working for all the .do actions.
And then again sometimes it would work fine.
However i could never find the problem.

so post up if you do find the problem.

Ajay


From: "Dhaliwal, Pritpal (HQP)" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Subject: RE: .do's come back as 404 file not found
Date: Fri, 5 Dec 2003 14:15:24 -0800
Hello Joe,

Its maps to *.do

Remember that same conf worked like a charm two days ago :)

Same conf is also working in another setting.

TIA,
Paul
-Original Message-
From: Joe Hertz [mailto:[EMAIL PROTECTED]
Sent: Friday, December 05, 2003 11:46 AM
To: 'Struts Users Mailing List'
Subject: RE: .do's come back as 404 file not found
What's the url pattern for your action servlet defined in web.xml?

> -Original Message-
> From: Dhaliwal, Pritpal (HQP) [mailto:[EMAIL PROTECTED]
> Sent: Friday, December 05, 2003 1:48 PM
> To: Struts Users Mailing List
> Subject: .do's come back as 404 file not found
>
>
> Hello Everyone,
>
> I am using: Struts and Resin 2.1.11
>
> All of sudden my index.do, or any other .do is not being
> recognized by resin anymore.
>
> It was working fine two days ago, all of sudden I am getting 404s
>
>
> In the logs I see that its picking up the correct
> struts-config.xml and it is that ActionServlet runs its init
> function..
>
> So has anyone seen it before, is it generally app server
> problem or I could have messed something up in struts also?
>
> TIA,
> Paul Dhaliwal
>


-
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]
_
Hot chart ringtones and polyphonics. Go to  
http://ninemsn.com.au/mobilemania/default.asp

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


Re: [OT] RE: Is it required to restart weblogic everytime after compiling ?? ? Need help Desperately .. :-(

2003-12-06 Thread Shakti
Hey there are some class files which are in the classpath weblogic.jar is
this the cause of the problem ??
is there a solution for this .. i mean if i can move them to my lib or some
other dir is this going to cause any problems ??

- Original Message -
From: "Vic Cekvenich" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, December 06, 2003 1:04 AM
Subject: Re: [OT] RE: Is it required to restart weblogic everytime after
compiling ?? ? Need help Desperately .. :-(


>
>
> Wendy Smoak wrote:
> >>and restarting this weblogic again and again
> >>each time i debug .. :-( ...
> >>stil waiting for a solution ...
> >
> >
> > Trim your posts!  Not only was it off topic, it was 400 lines long.  How
> > about doing your development work on Tomcat, then deploying to Weblogic?
> > This has the added advantage of forcing you to write code that'll run on
> > any container.
> >
> + 1.
>
> Or Resin, the both have a plug in to run w/ Eclipse so you set in even.
> In general, propriatory code is inferior.
>
> .V
>
>
>
> -
> 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]