Re: Filter / Logging

2006-03-14 Thread atta-ur rehman
Hi,

What's the url-pattern for you filter? If it's being called more than once
for an action I'd guess that you have it set to intercept all the requests.
Changing it to something specific, like *.do, might help.


  LoggingFilter
  *.do



HTH.

ATTA

On 3/14/06, Hans-Peter Petek <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> can anyone give some information about how and when filters are executed?
> I have a logging-filter who only logs the request-parameters - the filter
> is
> accessed at every page.
>
> But when I call a simple page (struts) with actionform and action the
> filter
> is accessed e.g. 10 times ...? why?
>
> thanks a lot
> Hans
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: [OT] Book recommendation requested: Object-Oriented Analysis and Design

2006-03-08 Thread atta-ur rehman
Thank you all for sharing your thoughts.

ATTA

On 3/8/06, Michael Jouravlev <[EMAIL PROTECTED]> wrote:
>
> On 3/8/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > I would also get the "Gang of Four" book if you don't have it -- the
> original "Design Patterns" book with code examples in C++.
>
> The early prints used to have a companion CD-ROM with full book
> content on it and a really thought-out design and navigation ;)
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


[OT] Book recommendation requested: Object-Oriented Analysis and Design

2006-03-07 Thread atta-ur rehman
Folks,

I was wondering if someone could please share some recommendations on a good
beginner book on the topic of OO analysis and design.

Thanks.

ATTA


Re: Reloading resource properties

2006-02-02 Thread atta-ur rehman
Jim,

What do you mean next time login? Logging in without reloading the app or
restarting Tomcat?

Did you if you had autoload set to on on your Tomcat app?

For most of the servers (both servlet containers like Tomcat and app servers
like Weblogic for example) I'd expect that you will have to reload the
application to be able to view the changes made in the props file.

HTH.

ATTA


On 2/2/06, Jim Reynolds <[EMAIL PROTECTED]> wrote:
>
> Apologize for a second question for the day ... but I ran into a issue.
>
> I developed a struts application on a Tomcat 5.5 engine. Whenever I
> updated a resource.property, the next time I would log in, I would see
> the new values. And that is how I thought it all worked. I believe it
> reloaded the property automatically.
>
> We moved the site to a production environment running SunOne Webserver
> 6.1  (Suns Server) and it does not appear to be updating the
> properties, unless we restart the instance.
>
> Any ideas how this should work?
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: What JDK version are you using?

2006-01-23 Thread atta-ur rehman
[X] JDK 1.5 (or JDK 5)

No validator.

HTH.

ATTA

On 1/23/06, Dave Newton <[EMAIL PROTECTED]> wrote:
>
> Simon Chappell wrote:
> > 1.4.1 and Struts 1.1
> >
> You're lucky.
>
> About 2/3 of our deployments are on 1.3.
>
> We use 1.3, 1.4, and new stuff will (hopefully) be 1.5.
>
> I'm using validator via the typical struts validation stuff.
> > Ain't corporate standards a wonderful thing? :-)
> >
> Sure. I tell myself that every day before I try to decide between
> driving 45 minutes to work and cutting my wrists.
>
> Dave
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: form submitted twice

2006-01-06 Thread atta-ur rehman
any anchors,  on the page?

any chance  the image is within a submit tag/button?

how/where your action is forwarding after processing?

ATTA

On 1/6/06, Faisal Shoukat <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
>
>
> I have a problem where for some unknown reason my form is submitted
> twice.  I have a action class which calls a delegate which calls a DAO
> class.
>
>
>
> When I press submit the form is submitted.  My code in the JSP is as
> follows:
>
>
>
> Javascript function called when submitting form:
>
>
>
> function setAction(action)
>
> {
>
>
>
> document.pendingRecordForm.action.value= action;
>
> document.pendingRecordForm.submit();
>
> }
>
>
>
> To submit the form the following image:
>
>  onclick="setAction('approve')"/>
>
>
>
> The submit then calls the perform method in my struts action class ( By
> the way I am using 1.0.2 version of Struts)
>
>
>
> The action class then works through the code and when the thread gets to
> the DAO class the second call arrives at the action class,
>
>
>
> This second call sends back a target of failure because of some
> validation error and the successful target from the first submit is
> ignored.
>
>
>
> I don't understand why my form gets submitted twice.
>
>
>
> The struts config is as follows for the action:
>
>
>
> 
> type="com.myclass."
>
> name="pendingRecordForm"
>
> scope="request"
>
> input="/jsp/approvexx.jsp">
>
> 
>
> 
>
> 
>
>
>
>
>
> Thanks in advance
>
>
>
>
>


Re: Implementation of new row functionality of HTML table in Struts

2005-12-19 Thread atta-ur rehman
Irfan,

You might want to conclude this thread for future readers with similar
issues. Scope, problem and solutions that didn't work and the one that
finally worked might be helpful.

Just my 2 paisas!

ATTA


On 12/19/05, Irfan Shaikh <[EMAIL PROTECTED]> wrote:
>
> Thanks guyz, done with adding new row functionality. :)
>
>
> On 12/19/05, Irfan Shaikh <[EMAIL PROTECTED]> wrote:
> >
> > I am getting same error when i submit the form having newly added row.
> > Error is :
> >
> > javax.servlet.ServletException: BeanUtils.populate
> >   org.apache.struts.util.RequestUtils.populate(RequestUtils.java
> :495)
> >   org.apache.struts.action.RequestProcessor.processPopulate(
> RequestProcessor.java:804)
> >
> >   org.apache.struts.action.RequestProcessor.process(
> RequestProcessor.java:203)
> >   org.apache.struts.action.ActionServlet.process(ActionServlet.java
> :1196)
> >   org.apache.struts.action.ActionServlet.doPost(ActionServlet.java
> > :432)
> >   javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> >   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> >
> > *root cause*
> >
> > java.lang.ArrayIndexOutOfBoundsException
> >   java.lang.reflect.Array.get(Native Method)
> >   org.apache.commons.beanutils.PropertyUtilsBean.getIndexedProperty(
> PropertyUtilsBean.java:437)
> >   org.apache.commons.beanutils.PropertyUtilsBean.getIndexedProperty
> > (PropertyUtilsBean.java:340)
> >   org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(
> PropertyUtilsBean.java:684)
> >   org.apache.commons.beanutils.PropertyUtilsBean.getProperty(
> PropertyUtilsBean.java:715)
> >
> > org.apache.commons.beanutils.BeanUtilsBean.setProperty(
> BeanUtilsBean.java:884)
> >   org.apache.commons.beanutils.BeanUtilsBean.populate(
> BeanUtilsBean.java:811)
> >   org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java
> > :298)
> >   org.apache.struts.util.RequestUtils.populate(RequestUtils.java
> :493)
> >   org.apache.struts.action.RequestProcessor.processPopulate(
> RequestProcessor.java:804)
> >   org.apache.struts.action.RequestProcessor.process(
> > RequestProcessor.java:203)
> >   org.apache.struts.action.ActionServlet.process(ActionServlet.java
> :1196)
> >   org.apache.struts.action.ActionServlet.doPost(ActionServlet.java
> :432)
> >   javax.servlet.http.HttpServlet.service(HttpServlet.java
> > :709)
> >
> >
> >
> >   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> >
> > Here is the reset() method:
> >
> >public void reset(ActionMapping mapping,HttpServletRequest request) {
> >
> >   System.out.println("reset called");
> >   int count=0;
> >   if (null!=this.customer) {
> >   String value = request.getParameter
> ("customer[0].firstName");
> >   System.out.println("value :" + value);
> >
> >   if (value != null) {
> >   while ((value = request.getParameter("customer[" +
> count + "].firstName")) != null) {
> >System.out.println("value :" + value);
> >
> >count++;
> >   }
> >   }
> >
> >   Customer[] customers = new Customer[count];
> >   System.out.println("Customer[] size :"+customers.length);
> >   ListTextActionForm f = new ListTextActionForm();
> >
> >   f.setCustomer(customers);
> >
> >   } else {
> >   System.out.println("Customer[] is null");
> >   }
> >}
> >
> > No error arise  if no new row is added and code work fine.
> >
> >
> > Any solution to this issue
> > atta-ur rehman: Can i have ur msn/hotmail id for efficient conversation.
> >
> > Thanks
> >
> >
>
>


Re: Implementation of new row functionality of HTML table in Struts

2005-12-19 Thread atta-ur rehman
so, have you been able to submit successfully?

On 12/19/05, Irfan Shaikh <[EMAIL PROTECTED]> wrote:
>
> Uses the HTMLArray values to populate each cell of table.
> Parameters :  eTable : Table which has to be processed
>  HTMLArray : Array of HTML Components that need to be used in the
> cells..
>
> function insertRow(eTable, HTMLArray, CellFocus) {
> // Insert the row and set the color etc.
> var eRow =  eTable.insertRow();
> eRow.bgcolor ="#ff";
>
> //Take each cell and process it.
> for (i=0; i < HTMLArray.length; i++) {
> varCell = eRow.insertCell();
> varCell.bgColor = "#DAE9F8";
> //varCell.align = "center";
> varCell.insertAdjacentHTML('afterBegin', HTMLArray[i]);
> }
>
> //Finally set the focus to the recently added row. Note that focus is
> returned to the First Cell in the row.
> //Assumption is that Cell(0) is the select Control. Cell(1) is where
> the
> user would like to start the data
> //entry.
> var NoOfRows = eTable.rows.length - 1;
> eTable.rows(NoOfRows).cells(CellFocus).childNodes(0).focus();
> }
>
> On 12/19/05, JEEVANATHAM P. /BPCRP/INFOTECH/VASHI <
> [EMAIL PROTECTED]> wrote:
> >
> > Same way I need to create a table and all fields are editable when user
> > double clicks.
> > Irfan can you tell me how can we create a new row using java script?
> >
> >
> > -Original Message-
> > From: Irfan Shaikh [mailto:[EMAIL PROTECTED]
> > Sent: Monday, December 19, 2005 1:12 PM
> > To: Struts Users Mailing List
> > Subject: Re: Implementation of new row functionality of HTML table in
> > Struts
> >
> > No, user can add has many row he needed before submit... I had just
> added
> > one row to handle this scenario... It should work for as many row user
> has
> > added...
> >
> >
> > On 12/19/05, atta-ur rehman <[EMAIL PROTECTED]> wrote:
> > >
> > > okay, so you're saying use can add only ONE row dynamically before
> > submit?
> > > and that the newly added row's HTML code is:
> > >
> > > 
> > >  
> > >   > > value="John">
> > >   > > value="Mark">
> > >  
> > >  
> > >
> > >
> > > if that's the case, in your ActionForm's reset method, detect that
> user
> > > has
> > > added a new row, maybe thru request.getParameter
> > ("customer[?].firstName")
> > > where ? will be an integer 0..n where reuqest.getParameter would
> return
> > > null
> > > for n+1. once you've done that do a:
> > >
> > > Customer[] customers = new Customer[n];
> > > form.set("customer", customers);
> > >
> > > see if that helps.
> > >
> > > ATTA
> > >
> > >
> > > On 12/18/05, Irfan Shaikh <[EMAIL PROTECTED]> wrote:
> > > >
> > > > Once again Generated HTML :
> > > >
> > > >  > > > action="/GenerateHTMLTable/listtext.do">
> > > >
> > > > 
> > > > 
> > > >   
> > > >   
> > > >
> > > > 
> > > > 
> > > > 
> > > > 
> > > >   
> > > >
> > > >   
> > > >
> > > > 
> > > >   
> > > >> > > value="Irfan">
> > > >
> > > >> > > value="Shaikh">
> > > >value="New
> > > > Mumbai">
> > > > 
> > > >
> > > > 
> > > >   
> > > >> > > value="Maruf1212">
> > > >> > > value="Dolani">
> > > >> > > value="Mumbai">
> > > > 
> > > >
> > > > 
> > > >   
> > > >
> > > >> > > value="Azima12">
> > > >> > > value="Kacchi">
> > > >> > > value="Pune">
> > > > 
> > > >
> > > > 
> > > >   
> > > >> > > value="Ruhi11133&

Re: Implementation of new row functionality of HTML table in Struts

2005-12-19 Thread atta-ur rehman
I think, ArrayIndexOutOfBoundsException actually shows that changes to the
DOM are being submitted.

ATTA

On 12/19/05, Michael Jouravlev <[EMAIL PROTECTED]> wrote:
>
> On 12/18/05, Irfan Shaikh <[EMAIL PROTECTED]> wrote:
> > No, user can add has many row he needed before submit... I had just
> added
> > one row to handle this scenario... It should work for as many row user
> has
> > added...
>
> I would start from verifying that browser sends all rows to the
> server. If you use Firefox, you can install LiveHTTPHeaders extension.
> It might happen that your DOM changes are incorrect somewhere.
>
> Michael.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Implementation of new row functionality of HTML table in Struts

2005-12-18 Thread atta-ur rehman
now i understand you're renaming the dynamically added textboxes thru
Javascript? right? if that's the case your renaming looks good to me. can
you do the trick in the form's reset() method; that is, set the a new
Customer array to the forms's property with something like:

String value = request.getParameter("customer[0].firstName");

  if (value != null) {
  int count = 1;
  while ((value = request.getParameter("customer[" + count +
"].firstName")) != null) {
  count++;
  }
  }

  Customer[] customers = new Customer[count];
  f.set("customer", customers);


On 12/18/05, Irfan Shaikh <[EMAIL PROTECTED]> wrote:
>
> No, user can add has many row he needed before submit... I had just added
> one row to handle this scenario... It should work for as many row user has
> added...
>
>
> On 12/19/05, atta-ur rehman <[EMAIL PROTECTED]> wrote:
> >
> > okay, so you're saying use can add only ONE row dynamically before
> submit?
> > and that the newly added row's HTML code is:
> >
> > 
> >  
> >   > value="John">
> >   > value="Mark">
> >  
> >  
> >
> >
> > if that's the case, in your ActionForm's reset method, detect that user
> > has
> > added a new row, maybe thru request.getParameter
> ("customer[?].firstName")
> > where ? will be an integer 0..n where reuqest.getParameter would return
> > null
> > for n+1. once you've done that do a:
> >
> > Customer[] customers = new Customer[n];
> > form.set("customer", customers);
> >
> > see if that helps.
> >
> > ATTA
> >
> >
> > On 12/18/05, Irfan Shaikh <[EMAIL PROTECTED]> wrote:
> > >
> > > Once again Generated HTML :
> > >
> > >  > > action="/GenerateHTMLTable/listtext.do">
> > >
> > > 
> > > 
> > >   
> > >   
> > >
> > > 
> > > 
> > > 
> > > 
> > >   
> > >
> > >   
> > >
> > > 
> > >   
> > >> > value="Irfan">
> > >
> > >> > value="Shaikh">
> > >   
> > > 
> > >
> > > 
> > >   
> > >> > value="Maruf1212">
> > >> > value="Dolani">
> > >> > value="Mumbai">
> > > 
> > >
> > > 
> > >   
> > >
> > >> > value="Azima12">
> > >> > value="Kacchi">
> > >> > value="Pune">
> > > 
> > >
> > > 
> > >   
> > >> > value="Ruhi11133">
> > >> > value="Khan">
> > >> > value="Pune">
> > > 
> > >
> > >
> > > 
> > >   
> > >> > value="John">
> > >> > value="Mark">
> > >   
> > >  (Hardcoded HTML row)
> > >
> > >   
> > >
> > >
> > > 
> > >
> > >
> >
> >
>
>


Re: Implementation of new row functionality of HTML table in Struts

2005-12-18 Thread atta-ur rehman
okay, so you're saying use can add only ONE row dynamically before submit?
and that the newly added row's HTML code is:


 
 
 
 
 


if that's the case, in your ActionForm's reset method, detect that user has
added a new row, maybe thru request.getParameter("customer[?].firstName")
where ? will be an integer 0..n where reuqest.getParameter would return null
for n+1. once you've done that do a:

Customer[] customers = new Customer[n];
form.set("customer", customers);

see if that helps.

ATTA


On 12/18/05, Irfan Shaikh <[EMAIL PROTECTED]> wrote:
>
> Once again Generated HTML :
>
>  action="/GenerateHTMLTable/listtext.do">
>
> 
> 
>   
>   
>
> 
> 
> 
> 
>   
>
>   
>
> 
>   
>value="Irfan">
>
>value="Shaikh">
>   
> 
>
> 
>   
>value="Maruf1212">
>value="Dolani">
>value="Mumbai">
> 
>
> 
>   
>
>value="Azima12">
>value="Kacchi">
>value="Pune">
> 
>
> 
>   
>value="Ruhi11133">
>value="Khan">
>value="Pune">
> 
>
>
> 
>   
>value="John">
>value="Mark">
>   
>  (Hardcoded HTML row)
>
>   
>
>
> 
>
>


Re: Implementation of new row functionality of HTML table in Struts

2005-12-18 Thread atta-ur rehman
Irfan,

By looking at the HTML source of the your page, please show me the name of
textboxes added thru  and name of the textboxes you've added
thru Javascript.

ATTA


On 12/17/05, Irfan Shaikh <[EMAIL PROTECTED]> wrote:
>
> I am storing data objects into an Array for initial rows and when user
> submit the form i am getting the updated values by using the code
> highlighted below
>
> public ActionForward execute(ActionMapping mapping,
>  ActionForm form,
>  HttpServletRequest request,
>  HttpServletResponse response){
>
> DynaActionForm f = (DynaActionForm) form;
> Customer[] s = (Customer[])f.get("customer");
>
> System.out.println("Number of Rows on page :" + s.length);
>
>
>if (s.length!=0) {
> insertAllCustomer(s);
> f.set("customer", s);
> } else {
> Customer[] custArray = getAllCustomer();
> f.set("customer", custArray);
> }
>
>   return (mapping.findForward("OK"));
> }
>
>the problem here is when i populate the data on page for the first time
> i
> have 4 rows and then i add a new row by javascript, and i submit the page,
> even then i get only 4 rows in execute method whereas i should get 5 rows
> so
> that i can get the new added row data to create a new Customer bean and
> put
> it back to Customer[] array (this is my collection)
>
> Here is the loop for rows genration on JSP page :
>
> 
>     
>   
>   
>   
>   
> 
>   
>
>
>
> Is there something i am missing here ?... Waiting for a reply desperately
> Thanks a lot.
>
> On 12/17/05, atta-ur rehman <[EMAIL PROTECTED]> wrote:
> >
> > Irfan,
> >
> > How are you storing data required for initial rows? As a collection of
> > objects in some scope that  uses to paint them on the
> page?
> >
> > When user submits the page how are you getting the updated values?
> > Populating the objects in the same collection or constructing a new
> > collection and adding a object for each row?
> >
> > If that's the case, then all you need to do is reset the collection of
> > objects to the new number of rows submitted by the user.
> > Commons-Collection,
> > which is required by Sturts(?) have a lazy-list which could be used for
> > this
> > purpose.
> >
> > ATTA
> >
> >
> > On 12/16/05, Irfan Shaikh <[EMAIL PROTECTED]> wrote:
> > >
> > > Hi All,
> > >  I am new to Struts and  need to implement a functionality
> where
> > a
> > > new row is added to table (generated using logic:iterate tag on JSP
> page
> > )
> > > on the fly(using javascript)  and handling newly added row in
> > > DynaActionForm
> > > so that row gets saved to database. Need to know how to create a bean
> > for
> > > newly added row.
> > >
> > > Suggestion will be highly appreciated.
> > > Thanks in advance
> > >
> > >
> >
> >
>
>


Re: Implementation of new row functionality of HTML table in Struts

2005-12-16 Thread atta-ur rehman
Irfan,

How are you storing data required for initial rows? As a collection of
objects in some scope that  uses to paint them on the page?

When user submits the page how are you getting the updated values?
Populating the objects in the same collection or constructing a new
collection and adding a object for each row?

If that's the case, then all you need to do is reset the collection of
objects to the new number of rows submitted by the user. Commons-Collection,
which is required by Sturts(?) have a lazy-list which could be used for this
purpose.

ATTA


On 12/16/05, Irfan Shaikh <[EMAIL PROTECTED]> wrote:
>
> Hi All,
>  I am new to Struts and  need to implement a functionality where a
> new row is added to table (generated using logic:iterate tag on JSP page )
> on the fly(using javascript)  and handling newly added row in
> DynaActionForm
> so that row gets saved to database. Need to know how to create a bean for
> newly added row.
>
> Suggestion will be highly appreciated.
> Thanks in advance
>
>


Re: accessing request attributes

2005-12-06 Thread atta-ur rehman
Chris,

I'm sure you'd know scriplet way of doing it, which I'm not going to
recommend: <%=request.getAttribute("toDate") %>.

Struts' bean:write should do it: 

Better still if you're using Servlet 2.4 compliant app server/servlet
container you could use JSTL expressions: ${toDate} and it will search the
attribute in app, session, request and page scope for you. Same thing as
. You'd, of course, need to include TLDs for JSTL
in the latter case.

Hope this helps.

ATTA



On 12/6/05, Christopher Becker <[EMAIL PROTECTED]> wrote:
>
> I am setting request attributes in an Action class such as in the
> following example:
>
> request.setAttribute("toDate", toDate);
> request.setAttribute("acctNum", acctNum);
>
> Both variables toDate and acctNum are Strings. I then process the
> action by returning a mapping.findForward to a JSP page.
>
> I wish to be able to access these attributes as scripting variables on
> my JSP page, and display their values if they happen to have them (e.g
> not empty String or null, which could be possible).
>
> My question - how do you access request attributes with Struts tags and
> make them available as scripting variables?
>
> I have tried using , but have been unsuccessful.
>
> Any guidance or help would be appreciated... thanks!
>
> --Chris
>
>


Re: Action.execute() only being invoked the first time a url is requested ??!!!

2005-11-17 Thread atta-ur rehman
Hi,

Most probably your page is gettnig cached by the browser. try








or

<%
response.setHeader("pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Cache-Control", "no-store");
response.setDateHeader("Expires", 0);
%>

to keep your browser from caching the page and see if it works.

HTH.

ATTA

On 11/17/05, Mon Cab <[EMAIL PROTECTED]> wrote:
>
>
> For Example if I type in my browser address bar:
>
> http://127.0.0.1:8080/webapp/userSignup.do?action=whatever
>
> The first time, I type this in, this invokes the
> execute method of my Action class (I'm using
> System.out ("Action execute Invoked") in Action
> execute to test this). If I then enter the exact same
> url, this method is not getting called.
>
> I am not using validator at all!!
>
> Can anyone explain what is going on with this?
>
>
>
>
> __
> Yahoo! FareChase: Search multiple travel sites in one click.
> http://farechase.yahoo.com
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: how to copy the properties of one Struts form-bean to another?

2005-10-27 Thread atta-ur rehman
Hi Starky,

Yes, I'd think that having a common super class for a set of form classes
that all have some common fields should be a good idea. Not only you get
shared fields but also reset() and validate() can be reused in subclasses,
for example.

ATTA


On 10/27/05, starki78 <[EMAIL PROTECTED]> wrote:
>
> Thank you for your answer!
> But if you have a shared form bean, would it also
> be an alternative to have a super class form
> bean with the shared paramters and the heritaged
> subclasses?
>
> Nice greetings
> Starky
>
>
>
>
>
>
> -- Initial Header ---
>
> From : "Wendy Smoak" [EMAIL PROTECTED]
> To : "Struts Users Mailing List" user@struts.apache.org
> Cc :
> Date : Wed, 26 Oct 2005 09:44:54 -0700
> Subject : Re: how to copy the properties of one Struts form-bean to
> another?
>
>
>
>
>
>
>
> > From: "starki78" <[EMAIL PROTECTED]>
> >
> > > thanks that was what I was exactly looking for!
> >
> > If you find yourself copying properties from form to form too much, you
> > might consider consolidating the forms.
> >
> > One of my Struts apps uses a single session-scoped form bean across the
> > entire app. It's a front end for accounting reports, so in this way I'm
> > able to easily 'remember' the list of accounts and other settings the
> person
> > was working with, no matter which report they're requesting.
> >
> > --
> > Wendy Smoak
> >
> >
> > -
> > 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: MockStrutsTestCase problem

2005-10-27 Thread atta-ur rehman
Hi,

what's the exception?

does your form class has a method getPb()/setPb() and is it non-null for the
current instance of the form?

ATTA

On 10/27/05, Kanuri, Chand <[EMAIL PROTECTED]> wrote:
>
> Hi,
> i am testing my action class using MockStrutsTestCase.
> the properties that are threre directly in the form are getting tested
> properly.
> but the nested properties(the properties of bean used in action form) are
> getting failed
>
> any ideas?
>
> my test case code looks like this
>
> public class PeopleActionTest extends MockStrutsTestCase {
> ItemBean pb=new ItemBean();
>
> /**
> *
> */
> public PeopleActionTest() {
> super();
> // TODO Auto-generated constructor stub
> }
>
> /**
> * @param arg0
> */
> public PeopleActionTest(String arg0) {
> super(arg0);
> // TODO Auto-generated constructor stub
> }
>
> protected void setUp() throws Exception {
> super.setUp();
>
> }
>
> public void tearDown() throws Exception {
> super.tearDown();
> }
>
> public void testPeopleAction() {
> try {
> setContextDirectory(new File("WebContent"));
> setConfigFile("/WEB-INF/struts-config.xml");
> setServletConfigFile("/WEB-INF/web.xml");
> setRequestPathInfo("/People");
> addRequestParameter("number", "126");
> addRequestParameter("pb.sortcode","68945");
> actionPerform();
> verifyTilesForward("success",
> ".view.generationDetails");
> RequestItem requestItem =
> RequestItem
> getSession().getAttribute(WebConstants.getRequestItemName());
> assertEquals("126", requestItem.getNumber();
> assertEquals("68945", requestItem .getItem().getCode());
>
> } catch (Exception e) {
> // TODO: handle exception
> }
>
> }
>
> }
>
> the Number is tested properly whereas Item sortcode failed
>
> any ideas please let me know
>
>
> This e-mail (and any attachments) may contain privileged and/or
> confidential information. If you are not the intended recipient please do
> not disclose, copy, distribute, disseminate or take any action in reliance
> on it. If you have received this message in error please reply and tell us
> and then delete it. Should you wish to communicate with us by e-mail we
> cannot guarantee the security of any data outside our own computer systems.
> For the protection of Legal & General's systems and staff, incoming emails
> will be automatically scanned.
>
> Any information contained in this message may be subject to applicable
> terms and conditions and must not be construed as giving investment advice
> within or outside the United Kingdom.
>
> The following companies are subsidiary companies of the Legal & General
> Group Plc which are authorised and regulated by the Financial Services
> Authority for advising and arranging the products shown: Legal & General
> Partnership Services Limited (insurance and mortgages), Legal & General
> Insurance Limited (insurance), Legal & General Assurance Society Limited
> (life assurance, pensions and investments), Legal & General Unit Trust
> Managers Limited and Legal & General Portfolio Management Services Limited
> (investments).
>
> They are registered in England under numbers shown.
> The registered office is Temple Court, 11 Queen Victoria Street, London
> EC4N 4TP.
>
> Legal & General Partnership Services Limited: 5045000 Legal & General
> Assurance Society Limited: 166055 Legal & General (Unit Trust Managers)
> Limited: 1009418 Legal & General (Portfolio Management Services) Limited:
> 2457525 Legal & General Insurance Limited: 423930
>
> They are registered with the Financial Services Authority under numbers
> shown. You can check this at 
> www.fsa.gov.uk/register
>
> Legal & General Partnership Services Limited: 300792 Legal & General
> Assurance Society Limited: 117659 Legal & General (Unit Trust Managers)
> Limited: 119273 Legal & General (Portfolio Management Services) Limited:
> 146786 Legal & General Insurance Limited: 202050
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Struts Form Logic Error

2005-10-24 Thread atta-ur rehman
Asad,

Is this your complete struts-config.xml? If so, you're missing 
collection in it. Please add your form in the  and then add the
"name" attribute in the action to refer to your form.





and then in your action mapping:




> 
>  />
> 


also make sure sure in your JSP you're using html:text struts tags and
setting appropriate properites:



This assumes your testForm has a getter/setter for zipCode.

Hope this helps.

ATTA




On 10/24/05, Asad Habib <[EMAIL PROTECTED]> wrote:
>
> Hello. I am new to Struts and currently developing a Struts application.
> For some reason, form variables are not being transmitted upon form
> submission and at the same time there is no error or stack trace that I
> can reference to diagnose the error. I am not able to access the form
> variables inside my action class for which I have provided the code below
> (i.e. the form variables always have a value of null). I have also
> provided the contents of struts-config.xml below. FYI, I am not using the
> Struts validator. Any help would be greatly appreciated. Thanks.
>
> - Asad
>
>
>
> package registration;
>
> import javax.servlet.http.*;
> import org.apache.struts.action.*;
>
> public class BusinessToolsStepOneAction extends Action {
> public ActionForward execute (ActionMapping mapping,
> ActionForm form,
> HttpServletRequest request,
> HttpServletResponse response)
> throws Exception {
> String businessName = request.getParameter("businessName");
> String businessAddress = request.getParameter("businessAddress");
> String businessZipCode = request.getParameter("businessZipCode");
> String businessPhoneNumber = request.getParameter("businessPhoneNumber");
>
> if ((businessName == null) || (businessAddress == null) ||
> (businessZipCode == null) || (businessPhoneNumber == null)) {
> return (mapping.findForward("missing-business-data"));
> }
> else {
> return (mapping.findForward("business-tools-step-two"));
> }
> }
> }
>
>
>
>
> 
>  "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
> "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd";>
>
> 
> 
> 
> 
>
> 
> 
> 
>  />
> 
> 
> 
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: How to handle forward instructions within an action class?

2005-09-30 Thread atta-ur rehman
Jeff,

Assuming the code snippet in a method that returns an ActionForward, like
the execute() method itself, you can instantiate ActionForward and return
it:

else if(action.equals("sendMessage"))
{
String member = request.getParameter("member");
ActionForward forward = new ActionForward(sendMemberInvite.jsp?member=" +
member);
return forward;
}


as for the exception, I think it's becuase Struts is trying to forward to
ActionForward *after* request dispatcher committed the response. Returning a
null, again assuming that the method is returning an ActionForward, would
tell Struts to leave the response alone.

else if(action.equals("sendMessage"))
{
String member = request.getParameter("member");
RequestDispatcher view =
request.getRequestDispatcher("sendMemberInvite.jsp?member=" + member );
view.forward(request, response);
return null;
}


Hope this helps.


ATTA

On 9/30/05, Jeff Thorne <[EMAIL PROTECTED]> wrote:
>
>
> I have the following code in an action class:
>
> else if(action.equals("sendMessage"))
> {
> String member = request.getParameter("member");
> RequestDispatcher view =
> request.getRequestDispatcher("sendMemberInvite.jsp?member=" + member );
> view.forward(request, response);
> }
>
>
> This code works successfully but is causing the following error in the
> tomcat log files
>
> Servlet.service() for servlet action threw exception
> java.lang.IllegalStateException: Cannot forward after response has been
> committed
>
> Can someone shed some light on why I am getting this error and how I
> should
> handle forward
> instructions within an action class. Any help or insight would be
> appreciated.
>
> Thanks,
> Jeff
>
>


Re: submit buttons - how to put them label from resource

2005-09-30 Thread atta-ur rehman
 
 



On 9/30/05, Borislav Sabev <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> I'd like to set a label of submit buttons getting it from property file.
> But seems that this is not possible.
> One other problem I see is that value attribute has two purposes: to set
> the label, and on submit to provide value for the request parameter. Is
> there any way they to be different?
> (consider i18n problem: my buton can have German, English, Italian etc
> labels but the parameter value I'd like to recieve always "save",
> "cancel" etc.
> Does somebody know something about this problem?
>
> Borislav
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: reset form in session scope

2005-09-30 Thread atta-ur rehman
The fundamental question is, can you afford a page submit for so callled
'reset' button? please change the 'reset' to 'submit' as shown below. Now
when user hits Reset, page is submitted with submit=reset; from this point
onwards you can clean stuff from session.

> 
> 
> 
> 
> 
> 
> 
 Reset  <-
> 
> 

ATTA

On 9/30/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> To do it the way you have shown then I would have to have a reset
> button/link next to the edit/delete link at the bottom of the page. Is
> that right?
>
> -Original Message-
> From: atta-ur rehman [mailto:[EMAIL PROTECTED]
> Sent: 30 September 2005 15:52
> To: Struts Users Mailing List
> Subject: Re: reset form in session scope
>
> Faisal,
>
> Are you saying you want to do it on client side? Using the 'normal' HTML
> reset? If so, I don't see how. That's why I assumed you're submitting
> for
> reset. The reset button only resets your form elements; and you can use
> javascript to call reset on more than one forms. But I don't see how can
> you
> get rid of results shown.
>
> Submitting for reset and claring sesion data would be easiest way. You
> can
> also use DHTML to remove results table from the current document if you
> absolutely want to do without a submit.
>
> I hope this helps.
>
> ATTA
>
> On 9/30/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> > The reset button from the search form does not go to the
> > actionclientaction class. Maybe I have explained it badly.
> >
> > My jsp has some search fields and the user enters criteria into these
> > then clicks submit.
> >
> > This returns a table of results further down the page with checkboxes
> > associated with each line of result. And a edit or delete link at the
> > bottom. The user can select multiple checkboxes then edit or delete
> the
> > results.
> >
> > Next to the submit button below the search criteria is a reset button.
> > How would I blank the search criteria and get rid of the results
> > displayed below by clicking on reset.
> >
> > At the moment I have
> >
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> >
> > in my jsp and in my form I have a blank reset method. But this does
> not
> > get called.
> >
> >
> >
> > -Original Message-
> > From: atta-ur rehman [mailto:[EMAIL PROTECTED]
> > Sent: 30 September 2005 15:30
> > To: Struts Users Mailing List
> > Subject: Re: reset form in session scope
> >
> > in the actionClient action class, on reset button click:
> >
> > ActionForm form = (ActionForm)
> session.getAttribute("searchClientForm");
> > if (form != null) {
> > form.reset(...);
> > }
> >
> > only if I understood your question correctly and search form is not
> > doing
> > anything with mapping and/or request in it's reset() method!
> >
> > ATTA
> >
> > On 9/30/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > >
> > > Hi,
> > >
> > > I have a search.jsp which contains two forms search form and a
> action
> > > form.
> > >
> > > The search form submits all the search criteria to the action class
> > > which queries the DB then returns a result. The action form then
> > > decides which action to do with what result.
> > >
> > > The problem I have is how do I reset the search form and the action
> > form
> > > with one button.
> > >
> > > I have two buttons on the search form, submit and reset. When I
> press
> > > reset I want to reset the search criteria and clear all the results
> > > which are being displayed.
> > >
> > > My struts config is as follows:
> > >
> > >  > > type="com.medina.web.action.SearchClientAction"
> > > name="searchClientForm"
> > > scope="session"
> > > input="/searchClient.jsp"
> > > validate="true">
> > > 
> > > 
> > >
> > >  > > type="com.medina.web.action.ActionClientAction"
> > > name="actionClientForm"
> > > scope="request"
> > > input="/searchClient.jsp"
> > > validate="true">
> > > 
> > > 
> > > 
> > > 
> > >
> > > I have the search form in the seesion scope so when the results are
> > > validated they are still displayed and do not disappear.
> > >
> > >
> >
> > -
> > 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: reset form in session scope

2005-09-30 Thread atta-ur rehman
Reset only works on the form elements:

http://www.htmlcodetutorial.com/forms/_INPUT_TYPE_RESET.html


On 9/30/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> The reset button seems to work fine before I do a search. Once I have
> returned some results the reset button does not seem to do anything
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: 30 September 2005 15:42
> To: user@struts.apache.org; [EMAIL PROTECTED]
> Subject: RE: reset form in session scope
>
> The reset button from the search form does not go to the
> actionclientaction class. Maybe I have explained it badly.
>
> My jsp has some search fields and the user enters criteria into these
> then clicks submit.
>
> This returns a table of results further down the page with checkboxes
> associated with each line of result. And a edit or delete link at the
> bottom. The user can select multiple checkboxes then edit or delete the
> results.
>
> Next to the submit button below the search criteria is a reset button.
> How would I blank the search criteria and get rid of the results
> displayed below by clicking on reset.
>
> At the moment I have
>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
> in my jsp and in my form I have a blank reset method. But this does not
> get called.
>
>
>
> -Original Message-
> From: atta-ur rehman [mailto:[EMAIL PROTECTED]
> Sent: 30 September 2005 15:30
> To: Struts Users Mailing List
> Subject: Re: reset form in session scope
>
> in the actionClient action class, on reset button click:
>
> ActionForm form = (ActionForm) session.getAttribute("searchClientForm");
> if (form != null) {
> form.reset(...);
> }
>
> only if I understood your question correctly and search form is not
> doing
> anything with mapping and/or request in it's reset() method!
>
> ATTA
>
> On 9/30/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> > Hi,
> >
> > I have a search.jsp which contains two forms search form and a action
> > form.
> >
> > The search form submits all the search criteria to the action class
> > which queries the DB then returns a result. The action form then
> > decides which action to do with what result.
> >
> > The problem I have is how do I reset the search form and the action
> form
> > with one button.
> >
> > I have two buttons on the search form, submit and reset. When I press
> > reset I want to reset the search criteria and clear all the results
> > which are being displayed.
> >
> > My struts config is as follows:
> >
> >  > type="com.medina.web.action.SearchClientAction"
> > name="searchClientForm"
> > scope="session"
> > input="/searchClient.jsp"
> > validate="true">
> > 
> > 
> >
> >  > type="com.medina.web.action.ActionClientAction"
> > name="actionClientForm"
> > scope="request"
> > input="/searchClient.jsp"
> > validate="true">
> > 
> > 
> > 
> > 
> >
> > I have the search form in the seesion scope so when the results are
> > validated they are still displayed and do not disappear.
> >
> >
>
> -
> 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: reset form in session scope

2005-09-30 Thread atta-ur rehman
Faisal,

Are you saying you want to do it on client side? Using the 'normal' HTML
reset? If so, I don't see how. That's why I assumed you're submitting for
reset. The reset button only resets your form elements; and you can use
javascript to call reset on more than one forms. But I don't see how can you
get rid of results shown.

Submitting for reset and claring sesion data would be easiest way. You can
also use DHTML to remove results table from the current document if you
absolutely want to do without a submit.

I hope this helps.

ATTA

On 9/30/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> The reset button from the search form does not go to the
> actionclientaction class. Maybe I have explained it badly.
>
> My jsp has some search fields and the user enters criteria into these
> then clicks submit.
>
> This returns a table of results further down the page with checkboxes
> associated with each line of result. And a edit or delete link at the
> bottom. The user can select multiple checkboxes then edit or delete the
> results.
>
> Next to the submit button below the search criteria is a reset button.
> How would I blank the search criteria and get rid of the results
> displayed below by clicking on reset.
>
> At the moment I have
>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
> in my jsp and in my form I have a blank reset method. But this does not
> get called.
>
>
>
> -Original Message-
> From: atta-ur rehman [mailto:[EMAIL PROTECTED]
> Sent: 30 September 2005 15:30
> To: Struts Users Mailing List
> Subject: Re: reset form in session scope
>
> in the actionClient action class, on reset button click:
>
> ActionForm form = (ActionForm) session.getAttribute("searchClientForm");
> if (form != null) {
> form.reset(...);
> }
>
> only if I understood your question correctly and search form is not
> doing
> anything with mapping and/or request in it's reset() method!
>
> ATTA
>
> On 9/30/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> > Hi,
> >
> > I have a search.jsp which contains two forms search form and a action
> > form.
> >
> > The search form submits all the search criteria to the action class
> > which queries the DB then returns a result. The action form then
> > decides which action to do with what result.
> >
> > The problem I have is how do I reset the search form and the action
> form
> > with one button.
> >
> > I have two buttons on the search form, submit and reset. When I press
> > reset I want to reset the search criteria and clear all the results
> > which are being displayed.
> >
> > My struts config is as follows:
> >
> >  > type="com.medina.web.action.SearchClientAction"
> > name="searchClientForm"
> > scope="session"
> > input="/searchClient.jsp"
> > validate="true">
> > 
> > 
> >
> >  > type="com.medina.web.action.ActionClientAction"
> > name="actionClientForm"
> > scope="request"
> > input="/searchClient.jsp"
> > validate="true">
> > 
> > 
> > 
> > 
> >
> > I have the search form in the seesion scope so when the results are
> > validated they are still displayed and do not disappear.
> >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: reset form in session scope

2005-09-30 Thread atta-ur rehman
in the actionClient action class, on reset button click:

ActionForm form = (ActionForm) session.getAttribute("searchClientForm");
if (form != null) {
form.reset(...);
}

only if I understood your question correctly and search form is not doing
anything with mapping and/or request in it's reset() method!

ATTA

On 9/30/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I have a search.jsp which contains two forms search form and a action
> form.
>
> The search form submits all the search criteria to the action class
> which queries the DB then returns a result. The action form then
> decides which action to do with what result.
>
> The problem I have is how do I reset the search form and the action form
> with one button.
>
> I have two buttons on the search form, submit and reset. When I press
> reset I want to reset the search criteria and clear all the results
> which are being displayed.
>
> My struts config is as follows:
>
>  type="com.medina.web.action.SearchClientAction"
> name="searchClientForm"
> scope="session"
> input="/searchClient.jsp"
> validate="true">
> 
> 
>
>  type="com.medina.web.action.ActionClientAction"
> name="actionClientForm"
> scope="request"
> input="/searchClient.jsp"
> validate="true">
> 
> 
> 
> 
>
> I have the search form in the seesion scope so when the results are
> validated they are still displayed and do not disappear.
>
>


Re: Serializable

2005-09-30 Thread atta-ur rehman
from:

http://java.sun.com/j2se/1.4.2/docs/api/java/io/Serializable.html

"When traversing a graph, an object may be encountered that does not support
the Serializable interface. In this case the NotSerializableException will
be thrown and will identify the class of the non-serializable object."

ATTA




On 9/30/05, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:
>
> I'm not sure it is a stupid question... I guess this enters the realm of
> generic Java question, but I can't say I've ever thought about this
> before... what happens if you have a class that implements serializable,
> and you then extend that class and add a member that is NOT serializable?
> Does that get flagged at compile-time? No, it wouldn't seem to:
>
> public class test implements java.io.Serializable { }
>
> class Nonser { }
>
> class test1 extends test {
> private Nonser ns = new Nonser();
> }
>
> This compiled without error or warning. Unless I'm missing something,
> class Nonser is NOT serializable, so by extension test1 should not be,
> even though it is extending a class that is itself serializable.
>
> Like I said, this is one of those things I've never thought about before,
> so I wonder what basic thing I've got messed up in my brain? :)
>
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
> AIM: fzammetti
> Yahoo: fzammetti
> MSN: [EMAIL PROTECTED]
>
> On Fri, September 30, 2005 3:57 am, Murray Collingwood said:
> > That's a very good point. I feel like I've asked a stupid question
> now
> > - duh!
> >
> > Thanks Starki
> >
> > On 30 Sep 2005 at 9:52, starki78 wrote:
> >
> >> I don't know if you have to use implements at all
> >> because
> >> the super-class does already implement it.
> >> What would you like to achieve?
> >>
> >> Regards Starki
> >>
> >>
> >>
> >>
> >> -- Initial Header ---
> >>
> >> From : "Murray Collingwood" [EMAIL PROTECTED]
> >> To : user@struts.apache.org
> >> Cc :
> >> Date : Fri, 30 Sep 2005 17:27:19 +1000
> >> Subject : Serializable
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> > Just a quick question.
> >> >
> >> > Does anybody follow any rule (personal or corporate) for when to use
> >> "implements
> >> > serializable" on a Struts form-bean?
> >> >
> >> > Kind regards
> >> > mc
> >> >
> >> >
> >> > FOCUS Computing
> >> > Mob: 0415 24 26 24
> >> > [EMAIL PROTECTED]
> >> > http://www.focus-computing.com.au
> >> >
> >> >
> >> >
> >> > --
> >> > No virus found in this outgoing message.
> >> > Checked by AVG Anti-Virus.
> >> > Version: 7.0.344 / Virus Database: 267.11.9/115 - Release Date:
> >> 29/09/2005
> >> >
> >> >
> >> > -
> >> > 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]
> >>
> >>
> >>
> >> --
> >> No virus found in this incoming message.
> >> Checked by AVG Anti-Virus.
> >> Version: 7.0.344 / Virus Database: 267.11.9/115 - Release Date:
> >> 29/09/2005
> >>
> >
> >
> >
> > FOCUS Computing
> > Mob: 0415 24 26 24
> > [EMAIL PROTECTED]
> > http://www.focus-computing.com.au
> >
> >
> >
> > --
> > No virus found in this outgoing message.
> > Checked by AVG Anti-Virus.
> > Version: 7.0.344 / Virus Database: 267.11.9/115 - Release Date:
> 29/09/2005
> >
> >
> > -
> > 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: How to remove the unwanted ???en_US string from ActionMessages

2005-09-27 Thread atta-ur rehman
Hi there,

try this:

if (username == null || username.trim().length() == 0){
ActionMessages messages = new ActionMessages();
ActionMessage message = new ActionMessage("credentials.empty");

> messages.add(ActioneMessages.GLOBAL_ERROR, message);
> saveMessages(request,messages);


}

Basically, the thing to note here that ActionMessage takes a key from the
resource file which I assumed "credentails.empty" is. The first parameter of
the ActionMessges.add(...) is the property against which error is being
stored or the generic global_error constant.

HTH.

ATTA




On 9/27/05, Kaizar Amin <[EMAIL PROTECTED]> wrote:
>
> Hello all,
>
> I am facing a wierd problem in my application. I want to add an
> ActionMessage in the ACTION (LoginAction) class and then display the
> message in the JSP page. In the JSP page, the messages are found without a
> problem (so my ApplicationResources.properties configuration is fine),
> however while prinintg them, the string "???en_US" and "???" gets attached
> to my message before and after respectively.
>
> ???en_US.???
>
> How do I get rid of these strings???
>
> I searched the discussion-list for similar problems/solutions and found
> this thread:
>
> http://www.mail-archive.com/user@struts.apache.org/msg27565.html
>
> However, the solution in that threads talks about using the presentation
> logic as follows:
>
> 
> 
> 
>
> But thats exactly how I am doing also. But for me it still gives the
> error.
> Below is the configuration and code snippets that I am using:
>
> In struts-config,xml
> 
> 
>
>
> In LoginAction.java
> 
> if (username == null || username.trim().length() == 0){
> ActionMessages messages = new ActionMessages();
> ActionMessage message = new ActionMessage("Username/Password cannot
> be empty");
> messages.add("credentials.empty", message);
> saveMessages(request,messages);
>
> In the JSP page
> 
> 
> 
> 
> 
> 
>
> The output I get is
> 
> ???en_US.Username/Password cannot be empty???
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Making cleaning after forwarding to page

2005-06-26 Thread atta-ur rehman
> Is that the cleanest way to do that?

probably not but you be the judge :)

http://forum.hibernate.org/viewtopic.php?t=927886


ATTA

On 6/26/05, Larry Meadors <[EMAIL PROTECTED]> wrote:
> That always struck me as a strange pattern when using hibernate -
> using the view (the web layer) to manage the data layer.
> 
> Is that the cleanest way to do that?
> 
> Larry
> 
> 
> On 6/26/05, atta-ur rehman <[EMAIL PROTECTED]> wrote:
> > Servlet filters would be way to go for this particular situation:
> >
> > http://www.hibernate.org/43.html
> >
> > HTH.
> >
> > ATTA
> >
> > On 6/25/05, Ashraf Fouad <[EMAIL PROTECTED]> wrote:
> > > I'm openning a hibernate session for each request, so I want to close this
> > > after rendering data in JSP, as usually the objects are lazy loaded so if 
> > > I
> > > closed the hibernate session, it will give execptions in page, so I need 
> > > to
> > > keep it alive with me till the end of data rendering then close this after
> > > execution, I already have code using the servlet filter, but I think 
> > > better
> > > do it cleaner way as struts may open this for customization.
> > >
> > > On 6/25/05, Martin Gainty <[EMAIL PROTECTED]> wrote:
> > > >
> > > > what are you 'cleaning' up?
> > > > session data?
> > > > entity data?
> > > > context data?
> > > >
> > > > Martin
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > >From: Ashraf Fouad <[EMAIL PROTECTED]>
> > > > >Reply-To: Ashraf Fouad <[EMAIL PROTECTED]>
> > > > >To: user@struts.apache.org
> > > > >Subject: Making cleaning after forwarding to page
> > > > >Date: Sat, 25 Jun 2005 16:55:30 +0300
> > > > >MIME-Version: 1.0
> > > > >Received: from mail.apache.org <http://mail.apache.org> 
> > > > >([209.237.227.199<http://209.237.227.199>])
> > > > by mc3-f2.hotmail.com <http://mc3-f2.hotmail.com>
> > > > >with Microsoft SMTPSVC(6.0.3790.211); Sat, 25 Jun 2005 06:55:45 -0700
> > > > >Received: (qmail 9390 invoked by uid 500); 25 Jun 2005 13:55:33 -
> > > > >Received: (qmail 9377 invoked by uid 99); 25 Jun 2005 13:55:33 -
> > > > >Received: from asf.osuosl.org <http://asf.osuosl.org> (HELO
> > > > asf.osuosl.org <http://asf.osuosl.org>) 
> > > > (140.211.166.49<http://140.211.166.49>)
> > > > by
> > > > >apache.org <http://apache.org> (qpsmtpd/0.29) with ESMTP; Sat, 25 Jun
> > > > 2005 06:55:33 -0700
> > > > >Received: pass (asf.osuosl.org <http://asf.osuosl.org>: domain of
> > > > [EMAIL PROTECTED] designates
> > > > >64.233.162.204 <http://64.233.162.204> as permitted sender)
> > > > >Received: from [64.233.162.204 <http://64.233.162.204>] (HELO
> > > > zproxy.gmail.com <http://zproxy.gmail.com>) 
> > > > (64.233.162.204<http://64.233.162.204>
> > > > )
> > > > >by apache.org <http://apache.org> (qpsmtpd/0.29) with ESMTP; Sat, 25 
> > > > >Jun
> > > > 2005 06:55:33 -0700
> > > > >Received: by zproxy.gmail.com <http://zproxy.gmail.com> with SMTP id
> > > > 13so47322nzn for
> > > > >; Sat, 25 Jun 2005 06:55:30 -0700 (PDT)
> > > > >Received: by 10.36.65.19 <http://10.36.65.19> with SMTP id
> > > > n19mr3077494nza; Sat, 25 Jun
> > > > >2005 06:55:30 -0700 (PDT)
> > > > >Received: by 10.36.5.4 <http://10.36.5.4> with HTTP; Sat, 25 Jun 2005
> > > > 06:55:30 -0700 (PDT)
> > > > >X-Message-Info: 6sSXyD95QpWvdDEghuU2CbVkYjl4MalRVurl1qmjVTE=
> > > > >Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> > > > >Precedence: bulk
> > > > >List-Unsubscribe: <mailto:[EMAIL PROTECTED]>
> > > > >List-Help: <mailto:[EMAIL PROTECTED]>
> > > > >List-Post: <mailto:user@struts.apache.org>
> > > > >List-Id: "Struts Users Mailing List" 
> > > > >http://user.struts.apache.org>
> > > > >
> > > > >Delivered-To: mailing list user@struts.apache.org
> > > > >X-ASF-Spam-Status: No, hits=0.3
> > > > >required=10.0tests=HTML_10_20,HTML_MESSAGE,RCVD_BY_IP
> > > > >X-

Re: Making cleaning after forwarding to page

2005-06-26 Thread atta-ur rehman
Servlet filters would be way to go for this particular situation:

http://www.hibernate.org/43.html

HTH.

ATTA

On 6/25/05, Ashraf Fouad <[EMAIL PROTECTED]> wrote:
> I'm openning a hibernate session for each request, so I want to close this
> after rendering data in JSP, as usually the objects are lazy loaded so if I
> closed the hibernate session, it will give execptions in page, so I need to
> keep it alive with me till the end of data rendering then close this after
> execution, I already have code using the servlet filter, but I think better
> do it cleaner way as struts may open this for customization.
> 
> On 6/25/05, Martin Gainty <[EMAIL PROTECTED]> wrote:
> >
> > what are you 'cleaning' up?
> > session data?
> > entity data?
> > context data?
> >
> > Martin
> >
> >
> >
> >
> >
> > >From: Ashraf Fouad <[EMAIL PROTECTED]>
> > >Reply-To: Ashraf Fouad <[EMAIL PROTECTED]>
> > >To: user@struts.apache.org
> > >Subject: Making cleaning after forwarding to page
> > >Date: Sat, 25 Jun 2005 16:55:30 +0300
> > >MIME-Version: 1.0
> > >Received: from mail.apache.org  
> > >([209.237.227.199])
> > by mc3-f2.hotmail.com 
> > >with Microsoft SMTPSVC(6.0.3790.211); Sat, 25 Jun 2005 06:55:45 -0700
> > >Received: (qmail 9390 invoked by uid 500); 25 Jun 2005 13:55:33 -
> > >Received: (qmail 9377 invoked by uid 99); 25 Jun 2005 13:55:33 -
> > >Received: from asf.osuosl.org  (HELO
> > asf.osuosl.org ) 
> > (140.211.166.49)
> > by
> > >apache.org  (qpsmtpd/0.29) with ESMTP; Sat, 25 Jun
> > 2005 06:55:33 -0700
> > >Received: pass (asf.osuosl.org : domain of
> > [EMAIL PROTECTED] designates
> > >64.233.162.204  as permitted sender)
> > >Received: from [64.233.162.204 ] (HELO
> > zproxy.gmail.com ) 
> > (64.233.162.204
> > )
> > >by apache.org  (qpsmtpd/0.29) with ESMTP; Sat, 25 Jun
> > 2005 06:55:33 -0700
> > >Received: by zproxy.gmail.com  with SMTP id
> > 13so47322nzn for
> > >; Sat, 25 Jun 2005 06:55:30 -0700 (PDT)
> > >Received: by 10.36.65.19  with SMTP id
> > n19mr3077494nza; Sat, 25 Jun
> > >2005 06:55:30 -0700 (PDT)
> > >Received: by 10.36.5.4  with HTTP; Sat, 25 Jun 2005
> > 06:55:30 -0700 (PDT)
> > >X-Message-Info: 6sSXyD95QpWvdDEghuU2CbVkYjl4MalRVurl1qmjVTE=
> > >Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> > >Precedence: bulk
> > >List-Unsubscribe: 
> > >List-Help: 
> > >List-Post: 
> > >List-Id: "Struts Users Mailing List" 
> > >http://user.struts.apache.org>
> > >
> > >Delivered-To: mailing list user@struts.apache.org
> > >X-ASF-Spam-Status: No, hits=0.3
> > >required=10.0tests=HTML_10_20,HTML_MESSAGE,RCVD_BY_IP
> > >X-Spam-Check-By: apache.org 
> > >DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta;
> > >d=gmail.com ;
> >
> > >h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type;
> > >
> >
> > >b=Yu5YIO99TiBf/Z2nl6LyNuQfFjQA5MHHQBkXXpVE/pqCSDrSyCVZT1OW2fG0KLUaxTPG+qcxTLyjvQhRHU1nbDVzUVROfxAqCf8yxWRT1JF6O123Iy769tcv/l9aSBbOStP1GM46H+fIOCedNsY8gOz9HlG2pGL/w0i+SC+w4nY=
> > >X-Virus-Checked: Checked by ClamAV on apache.org 
> > >Return-Path: [EMAIL PROTECTED]
> > >X-OriginalArrivalTime: 25 Jun 2005 13:55:45.0533 (UTC)
> > >FILETIME=[957DDAD0:01C5798D]
> > >
> > >Dears,
> > >I want to know where to customize in struts 1.2.7 inorder to make some
> > >cleanup after the request is frowarded to the jsp page, something like
> > >servlet filter.
> > > As I already have RequestProcessor.processPreProcess to handle an any
> > >request before forwarding to action class, I need some way to make
> > cleanup
> > >for after the JSP has been populated by data.
> > > The purpose of this is to handle the cleanup of Hibernate by closing it.
> > >
> > >--
> > >Thanks, best regards,
> > >Ashraf Fouad
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> --
> Thanks, best regards,
> Ashraf Fouad
> 
>

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



Re: access session object

2005-06-08 Thread atta-ur rehman
if you're running servlet container that supports 2.4 servlet specs
and you web app is also configured to be of version 2.4, thru 
element in your xml:

${myobject}

in your JSP should print it. in scriptlets:

<%=session.getAttribute("myobject")%>

should work.

"session" is reference to current session is available for all the JSPs.


HTH.

ATTA
P.S By the way, and no offence please, this isn't a Struts question as
much as a JSP question.

On 6/7/05, Tony Smith <[EMAIL PROTECTED]> wrote:
> Hi:
> 
> In my Action class, I stored a object in session with
> 
>  HttpSession session = request.getSession();
>  session.setAttribute("myobject", object);
> 
> How can I access this object from jsp?
> 
> Thanks,
> 
> 
> 
> 
> __
> Yahoo! Mail
> Stay connected, organized, and protected. Take the tour:
> http://tour.mail.yahoo.com/mailtour.html
> 
> 
> -
> 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: Security in Struts

2005-05-25 Thread atta-ur rehman
Hello Tarek,

I'd say front your application with a Servlet Filter that checks for
the security of the current page against security runles defined in
database/XML and probably cached for the current session to avoid
hitting database for every request.

ATTA

On 5/25/05, tarek.nabil <[EMAIL PROTECTED]> wrote:
> Hi everyone,
> 
> We're building a project using Struts and are about to start on the
> security module. The requirements are that security should be fine
> grained, which means that it can not be on the module level, but rather
> on the JSP or Action level. Actually, the users might ask for security
> on the button level, but we intend to push back on that one.
> 
> Are there any widely used approaches or best practices that we can
> follow?
> 
> Note that we will not be using J2EE based authentication and security,
> which means we have a custom login process.
> 
> Any suggestions are appreciated.
> 
> Thanks
> 
> -
> 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: use action-form's properties in JSTL

2005-05-25 Thread atta-ur rehman
Hi,

try 

formName.property

formName is the name that you defined in your struts.xml for the form
of current action. it should work. and the reason it works that Struts
puts the form object under the 'name' key in either request and
session scope depending upon the 'scope' attribute of your current
action.

Now JSTL shouldn't have a problem finding a bean in either request or
session scope as long as you know it's name.

hope this helps.

ATTA


On 5/25/05, Yaroslav Novytskyy <[EMAIL PROTECTED]> wrote:
> Hello!
> 
> How can I get a form's property in JSP to use it in EL in JSTL tags.
> 
> e.g.
> 
> 
> 
> 
>   <- define here
> 
><- use here
> 
> 
> 
> 
> Yaroslav Novytskyy
> 
> -
> 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: Autologin?

2005-05-24 Thread atta-ur rehman
I'll start with the first five :)

http://www.google.com.pk/search?q=servlet+filter&sourceid=mozilla-search&start=0&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:en-US:official

ATTA

On 5/24/05, Janek Ziniewicz <[EMAIL PROTECTED]> wrote:
> Thank you Michael, that link really helped me.
> 
> I have one more question. Wendy Smoak mentioned using Filter(s). Could
> you drop me some links describing what filters are? I 'd like to read
> something about it.
> 
> On 5/24/05, Michael Jouravlev <[EMAIL PROTECTED]> wrote:
> > This may help you: http://wiki.apache.org/struts/StrutsRememberMeCookie
> > You can modify the action and go to directly to user page instead of
> > showing the "remember me" checkbox.
> >
> > On 5/24/05, Jan Ziniewicz <[EMAIL PROTECTED]> wrote:
> > > I have problems with user logging in my application. Basically I want to
> > > have functionality same as on gmail.com -- if I have a proper cookie
> > > forward me to inbox omiting login page.
> > >
> > > I know how to play with cookies but struts part of the task is a problem
> > > for me
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> --
> Pozdrawiam,
> Janek Ziniewicz
> gg: 902858
> irc.freenode.net: #gore, #dub
> 
> -
> 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: [POLL] What do you use action forms for?

2005-05-12 Thread atta-ur rehman
#4

On 5/12/05, Marco Mistroni <[EMAIL PROTECTED]> wrote:
> #4 ..
> 
> > #1 - so I generate them from my POJOs using XDoclet.  All the other
> > frameworks I use (JSF, Spring, Tapestry and WebWork) allow me to use
> my
> > POJOs directly.
> >
> > Matt
> >
> > On May 11, 2005, at 4:02 PM, Michael Jouravlev wrote:
> >
> > > Turns out, that my way of using action forms differs from many other
> > > Struts users' habits. So, I am wondering how do you use action
> forms.
> > > I could not find the same poll in mailing list archives, so I am
> > > starting this one.
> > >
> > > You can answer here in the thread, or in the poll form, which I
> > > created on my site: http://www.superinterface.com/projects.htm But
> > > don't answer in both places ;) I wish wiki had a way to do polls.
> > >
> > > What is your preferred way to use action forms?
> > > #1 Prefer not to use action forms at all
> > > #2 For input data only (usually collected from HTML form)
> > > #3 For output only (to be used in JSP)
> > > #4 Same form for input and output
> > > #5 One form for input, another for output
> > > #6 Other
> > >
> > > Thanks,
> > >Michael.
> > >
> > >
> -
> > > 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]
> 
> -
> 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: getResources(HttpServletRequest) in ActionForm?

2005-04-16 Thread atta-ur rehman
Michael,

copy-n-paste worked! I did copy it to my BaseActionForm though!

thanks.

ATTA

On 4/16/05, Michael J. <[EMAIL PROTECTED]> wrote:
> Oh, it is protected. Then just cut and paste:
>   return ((MessageResources) request.getAttribute(Globals.MESSAGES_KEY));
> 
> Michael.
> 
> On 4/16/05, atta-ur rehman <[EMAIL PROTECTED]> wrote:
> > Hi all,
> >
> > Action class defines getResources(HttpServletRequest) method, thru
> > which I can get access to MessageResources.
> >
> > I don't see an equivalant method in ActionForm. Is it possible to get
> > access to resource files in ActionForm subclasses? If so, how would I
> > do it?
> >
> > Thanks.
>

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



getResources(HttpServletRequest) in ActionForm?

2005-04-16 Thread atta-ur rehman
Hi all,

Action class defines getResources(HttpServletRequest) method, thru
which I can get access to MessageResources.

I don't see an equivalant method in ActionForm. Is it possible to get
access to resource files in ActionForm subclasses? If so, how would I
do it?

Thanks.

ATTA

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



Re: Which MVC Layer ActionForm Belongs To?

2005-04-01 Thread atta-ur rehman
Frank,

I like your M+V+C channeling examples!

Thanks.

ATTA

On Apr 1, 2005 5:53 AM, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:
> "...we might as well be discussing how many angels can dance on the head
> of a pin"
> 
> 639.  704 if they all go to LA Weight Loss for 3 months.  But either way
> that assumes they haven't been drinking, otherwise they won't be able to
> keep their balance long enough to count.  I believe this research was
> done at AMD development labs in coming up with the Athlon 64.  But I
> couldn't find a reference online.
> 
> (Ahem.  There goes my standup career.)
> 
> About the ActionForms... I don't personally consider them part of either
> layer.  Tangentially, the same goes for Value Objects.  They straddle
> the line between two layers in my mind.  They are the channel through
> which the view communicates with the control layer, and Value Objects
> are the channel through which the control layer communicates with the
> model.  Hence, I don't consider them part of either layer.  Perhaps we
> should stop calling it MVC and instead call it M+V+C, with the + signs
> indicating those channels. :)
> 
> Perhaps that's a politician's answer, avoid giving a real answer to a
> sticky question :) but I actually feel like that fits the evidence, so
> to speak.  Depends on what the definition of "is" is I guess :)
> 
> Frank
> 
> Ted Husted wrote:
> > Well, you know, an ActionForm is what it is. :)
> >
> > On this list, most people will tell you it belongs to the View.
> >
> > Other frameworks with similar architectural members call gizmos like
> > ActionForms the "Model". Why? Because in classic MVC, the View
> > subscribes to the Model, most often as an Observer. In a conventional
> > Model 2 application, the View acquires data from the servlet contexts
> > --- meaning the servlet contexts become the M in MVC. The JSP Tags
> > "observe" critters like the ActionForm in the servlet contexts, hence,
> > the argument would go, it's part of the Model. Snagging data from the
> > contexts is not quite the Observer pattern, but it does have the same
> > effect.
> >
> > Of course, since most, or all, of that data actually comes from a
> > database, a lot of people tend to think of the database as the Model.
> > And, in the big picture, the database usually is the one-true Model.
> > But from the narrow perspective of Model-2 MVC, the JavaBeans we stuff
> > into the servlet contexts do become, for all intents and purposes, the
> > Model.
> >
> > One way to think of it is that our Views aren't designed to gaze upon
> > the Model directly. So, the Controller creates a specialized form of
> > the Model and places that chunk in the servlet context, where the
> > Views can see it. From the View's perspective, the dynamic data in the
> > servlet contexts is the Model. (Even though we know it's just a
> > runtime snapshot of one sliver of the most-high database Model.)
> >
> > As to ActionForms in particular, personally, I consider everything in
> > the Struts core (Action package) to be part of our Controller layer.
> > The taglibs are our View, but the rest, including the ActionForm, is
> > part of the Controller. The Controller simply shares the ActionForm
> > with the View by putting it the Servlet context (so it becomes part of
> > the Model as observed by the View).
> >
> > Of course, in the end, it doesn't really matter. The ActionForm is
> > what the ActionForm is. The one thing it is not, is a business object.
> > The Controller creates it from the request, and it bounces around
> > between the Action and the JSP Tags (or other View Tools). But, it
> > should *never* go past the Action into another layer.
> >
> > Aside from that key best practice -- the ActionForm should never go
> > past the Action into another layer -- we might as well be discussing
> > how many angels can dance on the head of a pin :)
> >
> > -Ted.
> >
> > On Mar 31, 2005 11:40 PM, atta-ur rehman <[EMAIL PROTECTED]> wrote:
> >
> >>Dea all,
> >>
> >>I'm sure I've seen this topic before! Just can't remember where and
> >>google won't help either! Can anybody please explain which MVC layer
> >>form belongs?
> >>
> >>TIA.
> >>
> >>ATTA
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
> >
> 
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
> 
>

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



Re: Which MVC Layer ActionForm Belongs To?

2005-04-01 Thread atta-ur rehman
Okay, Leon, 

Now I got to PRINT this and read before I speak!

Many thanks for your time and thoughts.

ATTA

On Apr 1, 2005 5:24 AM, Leon Rosenberg <[EMAIL PROTECTED]> wrote:
> On Fri, 2005-04-01 at 05:14 -0800, atta-ur rehman wrote:
> > Leon,
> >
> > Thanks for your thoughts.
> >
> > I just convinced myself that thinking ActionForm as a part of
> > Controller made most sense! Having said that, I'll be thinking more
> > about your point of view.
> >
> 
> :-)))
> If you feel comfortable with it :-)
> 
> but maybe you should check out this:
> 
> The MVC architecture has its roots in Smalltalk, where it was originally
> applied to map the traditional input, processing, and output tasks to
> the graphical user interaction model. However, it is straightforward to
> map these concepts into the domain of multi-tier enterprise
> applications.
> 
>   * Model - The model represents enterprise data and the business
> rules that govern access to and updates of this data. Often the
> model serves as a software approximation to a real-world
> process, so simple real-world modeling techniques apply when
> defining the model.
>   * View -The view renders the contents of a model. It accesses
> enterprise data through the model and specifies how that data
> should be presented. It is the view's responsibility to maintain
> consistency in its presentation when the model changes. This can
> be achieved by using a push model, where the view registers
> itself with the model for change notifications, or a pull model,
> where the view is responsible for calling the model when it
> needs to retrieve the most current data.
>   * Controller - The controller translates interactions with the
> view into actions to be performed by the model. In a stand-alone
> GUI client, user interactions could be button clicks or menu
> selections, whereas in a Web application, they appear as GET and
> POST HTTP requests. The actions performed by the model include
> activating business processes or changing the state of the
> model. Based on the user interactions and the outcome of the
> model actions, the controller responds by selecting an
> appropriate view.
> 
> -
> 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: Which MVC Layer ActionForm Belongs To?

2005-04-01 Thread atta-ur rehman
Leon,

Thanks for your thoughts. 

I just convinced myself that thinking ActionForm as a part of
Controller made most sense! Having said that, I'll be thinking more
about your point of view.

Regards,

ATTA

On Apr 1, 2005 4:59 AM, Leon Rosenberg <[EMAIL PROTECTED]> wrote:
> On Fri, 2005-04-01 at 06:01 -0500, Ted Husted wrote:
> > Well, you know, an ActionForm is what it is. :)
> >
> > On this list, most people will tell you it belongs to the View.
> >
> 
> To shorten Ted's post:
> 
> This depends on your viewpoint. Inside the presentation layer it's 100%
> the model. If you are talking about the presentation layer, refer to
> ActionForm as Model.
> 
> If you are talking about the system architecture, the whole presentation
> layer is a view on the business layer. In this case ActionForm is part
> of the view.
> 
> regards
> Leon
> 
> > Other frameworks with similar architectural members call gizmos like
> > ActionForms the "Model". Why? Because in classic MVC, the View
> > subscribes to the Model, most often as an Observer. In a conventional
> > Model 2 application, the View acquires data from the servlet contexts
> > --- meaning the servlet contexts become the M in MVC. The JSP Tags
> > "observe" critters like the ActionForm in the servlet contexts, hence,
> > the argument would go, it's part of the Model. Snagging data from the
> > contexts is not quite the Observer pattern, but it does have the same
> > effect.
> >
> > Of course, since most, or all, of that data actually comes from a
> > database, a lot of people tend to think of the database as the Model.
> > And, in the big picture, the database usually is the one-true Model.
> > But from the narrow perspective of Model-2 MVC, the JavaBeans we stuff
> > into the servlet contexts do become, for all intents and purposes, the
> > Model.
> >
> > One way to think of it is that our Views aren't designed to gaze upon
> > the Model directly. So, the Controller creates a specialized form of
> > the Model and places that chunk in the servlet context, where the
> > Views can see it. From the View's perspective, the dynamic data in the
> > servlet contexts is the Model. (Even though we know it's just a
> > runtime snapshot of one sliver of the most-high database Model.)
> >
> > As to ActionForms in particular, personally, I consider everything in
> > the Struts core (Action package) to be part of our Controller layer.
> > The taglibs are our View, but the rest, including the ActionForm, is
> > part of the Controller. The Controller simply shares the ActionForm
> > with the View by putting it the Servlet context (so it becomes part of
> > the Model as observed by the View).
> >
> > Of course, in the end, it doesn't really matter. The ActionForm is
> > what the ActionForm is. The one thing it is not, is a business object.
> > The Controller creates it from the request, and it bounces around
> > between the Action and the JSP Tags (or other View Tools). But, it
> > should *never* go past the Action into another layer.
> >
> > Aside from that key best practice -- the ActionForm should never go
> > past the Action into another layer -- we might as well be discussing
> > how many angels can dance on the head of a pin :)
> >
> > -Ted.
> >
> > On Mar 31, 2005 11:40 PM, atta-ur rehman <[EMAIL PROTECTED]> wrote:
> > > Dea all,
> > >
> > > I'm sure I've seen this topic before! Just can't remember where and
> > > google won't help either! Can anybody please explain which MVC layer
> > > form belongs?
> > >
> > > TIA.
> > >
> > > ATTA
> >
> > -
> > 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]



Which MVC Layer ActionForm Belongs To?

2005-03-31 Thread atta-ur rehman
Dea all,

I'm sure I've seen this topic before! Just can't remember where and
google won't help either! Can anybody please explain which MVC layer
form belongs?

TIA.

ATTA

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



Re: Do I need ActionForm or DynaActionForm?

2004-12-27 Thread atta-ur rehman
No! there won't be any problem at all if you don't use any form at
all! Just set your collection of records as request attribute and off
it goes to JSP!

ATTA


On Mon, 27 Dec 2004 17:01:16 +0530, uma.k <[EMAIL PROTECTED]> wrote:
> Hi,
> I wanted to fetch some records from the database and show it to the user in
> a JSP. Do I need ActionForm or DynaActionForm class?
> 
> What if I dont use any of these classes? Will there be any problem?
> 
> Uma
> 
> -
> 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]



Confirmation messages in Spring

2004-12-06 Thread atta-ur rehman
Matt,

Have you discovered any 'standard' way of putting up confirmation
message in Spring or you still advocate using HttpSession a a vehicle
as donein Equinox?

Regards,

ATTA

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



Data in a MxN grid

2004-11-29 Thread atta-ur rehman
All,

What's the 'standard' way in Struts to input data in a table whose
number of rows and columns (yes, for both rows and columns)  is
decided dynamically on every request? Indexed properties don't seem to
be working with variable number of columns.

So far I've to deal with only  elements but this may as
well include other input types as well.

Thanks in advance for any help. Any references of example would be
highly appereciated.

ATTA

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



Re: [OT] User Preference System Design

2004-11-17 Thread atta-ur rehman
if JDK 1.4 is an option you might want to take a look at:

java.util.prefs.*

HTH.

ATTA


On Tue, 16 Nov 2004 19:09:55 -0800 (PST), Julian <[EMAIL PROTECTED]> wrote:
> Hi, I am a Struts Newbie and would appreciate if
> anyone could give me some pointers on a user
> preferences/ configuration system design.  Perhaps a
> link to a good resource?  I have an ASP system with
> several levels of "users" that are as broad as an
> organization and as fine-grained as an individual
> person with one role.  I would like to have a
> preference system that can handle configuration and
> preference issues for the different levels of the
> application.  The information stored in these
> configurations range from font colors and alert boxes
> to the availability of various modules in the web
> application.  Currently the information is stored in
> xml files on the server's hard disk, but this will not
> suit a distributable environment.  Any suggestions are
> greatly appreciated.
> 
> Thanks in Advance,
> Julian
> 
> =
> Live simply so others may simply live.
> 
> -Ghandi
> 
> Pluralitas non est ponenda sine neccesitate.
> "Entities should not be multiplied unneccesarily"
> 
> -William of Occam
> 
> __
> Do you Yahoo!?
> The all-new My Yahoo! - Get yours free!
> http://my.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: Need an alternative to bean:define

2004-11-02 Thread atta-ur rehman
Is JSTL an option? I find Struts Logic tag hard to read! If so, I
think this should do:




  




HTH. Of course this is from top of my head, i haven't tried it.

ATTA

On Tue, 02 Nov 2004 16:16:25 -0800, Janice <[EMAIL PROTECTED]> wrote:
> My brain has stopped working.  I need an alternative to bean:define.
> 
> What I'm TRYING to do is iterate through a list, displaying a certain bit of
> code only when its different than the last iteration (grouping).
> 
> Here's a snip:
> 
> 
> 
> 
> 
>  value="<%=lastClientName%>">
> 
>   
> client: 
>   
> 
>  />
> 
> 
> End of snip.
> 
> This won't compile since bean "lastClientName" has already been defined.  I
> can't change my version of Struts.
> 
> What would be some clean syntax to use instead?
> 
> Thanks so much in advance!
> 
> J
> 
> -
> 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: Location of log4j.xml

2004-10-26 Thread atta-ur rehman
Paul,

Putting it in web-inf/classes should do  the trick.

ATTA


On Tue, 26 Oct 2004 11:51:41 -0400, Paul Summers
<[EMAIL PROTECTED]> wrote:
> I want to use Log4j in my Struts application. Where do I place my
> log4j.xml file so that the application loads my loggers?
> 
> In the past I wrote a plugin that loaded the loggers but I don't think
> it has to be that complicated.
> 
> Thanks,
> Paul
> 
> -
> 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]



[OT] Request for comments on DAO pattern implementation

2004-10-08 Thread atta-ur rehman
Dear all,

I've contemplated two ways of implementing DAO pattern; and I'm unable
to decide which is better :) Any comments on pros and cons of these
two approaches will be greatly appericiated.

Implementation 1: Have IDAO interface and let all the DAO objects
implement this interface; with probably an abstract class in between.
Every method need to cast Object down to its relevant DTO and throw
exception if the DTO is not of expected type.

public interface IDAO {

  Object findByPrimaryKey(final Object key);
  Collection findByCriteria(final String whereClause);
  Object insert(final Object o);
  void delete(final Object o);
  void update(final Object o);
  Collection getAll();
}

public class FooDAO implements IDAO {
..
}

Or  approach 2: every DAO is a class of its own with all the methods
only accepting the expecting DTOs!

public class FooDAO {

Foo findByPrimarykey(Object pk);
insertFoo(Foo);
deleteFoo(Foo);
updateFoo(Foo)
Collection getAll();
}

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



[OT] Struts + Spring

2004-09-20 Thread atta-ur rehman
Folks,

I've seen quite a few references to Struts and Spring integration
while browsing this mail archive. I was wondering why would I ever
want to use Spring with Struts application?

I hope people who have experience with both of these framework would
shed some light on this question.

Regards,

ATTA

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



Re: Idea for chain and DB transactions

2004-09-18 Thread atta-ur rehman
Craig,

That sounds pretty exciting. Now, how could I, if at all, incorporate
this Filter/Chian functionality in my existing Struts 1.1 app?

ATTA


On Sat, 18 Sep 2004 07:19:45 -0700, Craig McClanahan <[EMAIL PROTECTED]> wrote:
> Commons Chain (on which Struts Chain is based) has a design pattern
> built in for the general case were one command in the chain wants to
> allocate resources that will be required for later commands in the
> chain, plus the ability to clean up that resource when the chain
> completes.  See the Javadocs for org.apache.commons.chain.Filter.
> 
> For example, assume you want to allocate a connection from a
> connection pool defined as a JNDI resource (the same principle applies
> to any other sort of resource allocation factory) -- create a Filter
> with the following functionality:
> 
> * In the execute() method, acquire a reference to the data source,
>   acquire a connection, and store it as an attribute in the context.
> 
>   public boolean execute(Context context) throws Exception {
>   InitialContext ic = new InitialContext();
>   DataSource ds = (DataSource)
> ic.lookup("java:comp/env/jdbc/CustomerDatabase");
>   Connection conn = ds.getConnection();
>   context.put("connection", conn);
>   return false;
>   }
> 
> * In the postprocess() method, call close() on the connection,
>   which returns it to the pool:
> 
>   public boolean postprocess(Context context, Exception exception) {
> Connection conn = (Connection) context.get("connection");
> conn.close();
> return false;
>   }
> 
>   Note that the postprocessing method will be called even if an
> exception was thrown in a
>   subsequently called command.
> 
> In all other commands, the execute() method can simply use the
> allocated resource, without having to care how it got there:
> 
>   public boolean execute(Context context) throws Exception {
> Connection conn = (Connection) context.get("connection");
> ... use the connection to perform database transactions ...
>   }
> 
> Using this design, you don't have to worry about external storage of
> the allocated resources -- just store them under a well known
> attribute name in the context object that is passed in to all
> commands.
> 
> Craig
> 
> On Fri, 17 Sep 2004 14:43:57 -0400, Sean Schofield
> 
> 
> <[EMAIL PROTECTED]> wrote:
> > I have a problem and a proposed solution.  I would greatly appreciate any feedback 
> > about the proposed solution.
> >
> > Problem:
> > ===
> > I'm currently using a Struts application with a connection pool (using DBCP as 
> > supplied by Tomat).  When a database update is needed, the Struts actions will 
> > call the facade which will talk to my service layer (currently POJO's which handle 
> > business logic.)  My service layer in turn talks to the appropriate DAO.  Each of 
> > these DAO's extends from a common abstract class that provides basic functionality 
> > including obtaining a connection from the DataSource (via the pool).  A key aspect 
> > of my design is that some updates are in distinct areas of the database and so I 
> > have different DAO's for each area (ex. one for "workflow" on for "document.")
> >
> > As currently implemented I am unable to take advantage of transactions because the 
> > two DAOs will be getting a connection indepently from the pool and they will most 
> > likely not obtain the connection each time.  If I could just get the same 
> > connection each time, then I could use setAutoCommit(false).
> >
> > Proposed Solution:
> > ==
> > I'm thinking I could set up a few chains for the various kind of updates.  The 
> > chains would be called by the POJO service layer (instead of calling the DAO's 
> > directly.)  The first Command in the chain would be to indentify all database 
> > updates in the chain as needing transactions.  This would be done through a static 
> > method on a new object called TransactionManager.  Basically I would have a 
> > hashtable that would maintain connections for the duration of the chain.  The 
> > connections would be stored by the current thread (use that as the key to the 
> > table.)
> >
> > Then when a command down the line needs a database connection, it would first 
> > check to see if there is one already set aside for it to use.  Actually the 
> > command would call the DAO and the DAO would check.  The command would also be 
> > decorated by a custom wrapper so that if the DAO's try to close the connection, 
> > I'll ignore it.  Then when the chain does the post processing in reverse order.  
> > So the last clean up step will be to check for my custom DAOException.  If there 
> > is one, then rollback, otherwise commit.  Finally, the connection is removed from 
> > the TransactionManager.
> >
> > I think this might be crazy enough to work.  I know we could allways use EJB and 
> > get transactions but that might be overkill since the volume is very light (this 
> > is custom software for a governmen

Re: Accessing index properties in javascript validator

2004-07-23 Thread atta-ur rehman
Thanks Mark. I can see this is definitely better way of doing it!

ATTA

On Fri, 23 Jul 2004 11:40:18 +0200, Mark Lowe <[EMAIL PROTECTED]> wrote:
> Similarly but more compatible with older browsers.
> 
> total = ${fn:length(theForm.properties)};
> form = document.forms["theForm"];
> for(i = 0;i < total;i++) {
> target = "property["+ i +"]";
> element = form.elements[target];
> alert(element.name +"="+ element.value);
> }
> 
> Mark
> 
> 
> 
> 
> On 23 Jul 2004, at 02:09, atta-ur rehman wrote:
> 
> > hello,
> >
> > this is how i've done it:
> >
> > textbox = document.getElementById("block[0]");
> > if (textbox.value )
> >
> >
> > so basically you use document.getElementById("property[0]") to get the
> > reference of html elment and then use .value or any other stuff on
> > this element.
> >
> > hope this helps!
> >
> > ATTA
> >
> >
> >
> > On Thu, 22 Jul 2004 11:48:45 +0800, Ding Lei <[EMAIL PROTECTED]> wrote:
> >> Hi list,
> >>   Some JSP pages uses Strut's indexed properties, like:
> >> 
> >>   And it could be accessed by the corresponding Action correctly
> >> through
> >> a customized Form.
> >>   The problem is that I would like to add javascript validation before
> >> the user submits the form to check if the file box is not null &
> >> valid. But
> >> JS code doesn't seem to be able to access variables with braces.
> >>   Any ideas? Thanks in advance.
> >>
> >> --
> >> Layman <[EMAIL PROTECTED]> Ext: 8059
> >>
> >> Chivalry, Schmivalry!
> >> Roger the thief has a
> >> method he uses for
> >> sneaky attacks:
> >> Folks who are reading are
> >> Characteristically
> >> Always Forgetting to
> >> Guard their own bac ...
> >>
> >> -
> >> 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]
> 
>

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



Re: Accessing index properties in javascript validator

2004-07-22 Thread atta-ur rehman
hello,

this is how i've done it:

textbox = document.getElementById("block[0]");
if (textbox.value )


so basically you use document.getElementById("property[0]") to get the
reference of html elment and then use .value or any other stuff on
this element.

hope this helps!

ATTA



On Thu, 22 Jul 2004 11:48:45 +0800, Ding Lei <[EMAIL PROTECTED]> wrote:
> Hi list,
>   Some JSP pages uses Strut's indexed properties, like:
> 
>   And it could be accessed by the corresponding Action correctly through
> a customized Form.
>   The problem is that I would like to add javascript validation before
> the user submits the form to check if the file box is not null & valid. But
> JS code doesn't seem to be able to access variables with braces.
>   Any ideas? Thanks in advance.
> 
> --
> Layman <[EMAIL PROTECTED]> Ext: 8059
> 
> Chivalry, Schmivalry!
> Roger the thief has a
> method he uses for
> sneaky attacks:
> Folks who are reading are
> Characteristically
> Always Forgetting to
> Guard their own bac ...
> 
> -
> 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: Sharing Fields Between 2 Forms

2004-07-22 Thread atta-ur rehman
hi,

yes it's possible if both the form classes are inherited from the same
base class that has the common field getter/setter defined in it.

but why not have the same field in the both the forms? won't it be easier?

ATTA

On Thu, 22 Jul 2004 18:11:31 +0100, Ciaran Hanley
<[EMAIL PROTECTED]> wrote:
> Hello,
> 
> Is it possible for forms to share a common field?
> 
> I have two forms on a page which both need to gather data from a
> html:textarea.
> 
> I do not want to have two textareas on the JSP however so I can I share one
> between both forms?
> 
> Thanks,
> 
> CH
> 
>

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



Re: Tag question

2004-07-20 Thread atta-ur rehman
howdy Erik!

well, i was actually answering your original question about how to set
a var using  and scriptlet!

As Erez has mentioned you'd need to use some String.substring() to do the trick!

ATTA

On Tue, 20 Jul 2004 16:56:13 -0400, Erik Weber <[EMAIL PROTECTED]> wrote:
> Hmm I must be doing something wrong. That's giving me the same value as
> Erez's example. Strange, I would have expected it to give me
> "/services". I wonder how I am causing it to give me "/usecase/page.jsp".
> 
> 
> 
> atta-ur rehman wrote:
> 
> >Hi Erik,
> >
> >This one worked for me:
> >
> >
> >   <%= request.getServletPath() %>
> >
> >
> >
> >
> >
> >HTH,
> >
> >ATTA
> >
> >On Tue, 20 Jul 2004 16:20:30 -0400, Erik Weber <[EMAIL PROTECTED]> wrote:
> >
> >
> >>How can I set a variable (I assume with c:set) that will hold the value
> >>of request.getServletPath, so that I can use it in el tags?
> >>
> >>Thanks,
> >>Erik
> >>
> >>-
> >>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]
> 
>

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



Re: Tag question

2004-07-20 Thread atta-ur rehman
Hi Erik,

This one worked for me:


<%= request.getServletPath() %>





HTH,

ATTA

On Tue, 20 Jul 2004 16:20:30 -0400, Erik Weber <[EMAIL PROTECTED]> wrote:
> How can I set a variable (I assume with c:set) that will hold the value
> of request.getServletPath, so that I can use it in el tags?
> 
> Thanks,
> Erik
> 
> -
> 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: # anchor

2004-07-09 Thread atta-ur rehman
okay some wrong key i pressed! so to continue:

on body onload


  onload="location.hash='newBlock'";
 
>

does the trick for me!

ATTA
- Original Message - 
From: "atta-ur rehman" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, July 09, 2004 11:28 AM
Subject: Re: # anchor


> Hello Glenn,
>
> I've used a little javascript to the trick; though i'm sure there must be
> some better way of doing it:
>
> have an anchor in your jsp:
>
> 
> - Original Message - 
> From: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, July 09, 2004 10:55 AM
> Subject: # anchor
>
>
> > Hi,
> >
> > This is what I have defined:
> >
> >  > name="pageForm" scope="request" validate="false">
> >
> >
> > 
> >
> >  > scope="request" validate="true" input="/Page.do">
> > > contextRelative="false">
> >
> > > path="/Page.do">
> >
> > > contextRelative="false">
> >
> > 
> >
> > What happens is that the Page.do allows a user to enter report
parameters.
> > The PageSubmit.do builds the report and then returns the report to the
> > Page.do.
> > Once here, the user has the report parameters at the top and the report
> > under the parameters.
> >
> > However, the user would like to have the page move down a little so the
> > that the report section is more apparent.
> > I have tried to use the # anchor but keep getting page not found...
> >
> > Any help is appreciated!
> > Glenn
>
>
>
> -
> 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: # anchor

2004-07-09 Thread atta-ur rehman
Hello Glenn,

I've used a little javascript to the trick; though i'm sure there must be
some better way of doing it:

have an anchor in your jsp:


- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 09, 2004 10:55 AM
Subject: # anchor


> Hi,
>
> This is what I have defined:
>
>  name="pageForm" scope="request" validate="false">
>
>
> 
>
>  scope="request" validate="true" input="/Page.do">
> contextRelative="false">
>
> path="/Page.do">
>
> contextRelative="false">
>
> 
>
> What happens is that the Page.do allows a user to enter report parameters.
> The PageSubmit.do builds the report and then returns the report to the
> Page.do.
> Once here, the user has the report parameters at the top and the report
> under the parameters.
>
> However, the user would like to have the page move down a little so the
> that the report section is more apparent.
> I have tried to use the # anchor but keep getting page not found...
>
> Any help is appreciated!
> Glenn



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



Re: Form with n columns and m raws

2004-07-09 Thread atta-ur rehman
Hello Damien,

have a new class called row:

public class Row {

 private List items;

 public Row(int size, String defaultValue) {
  items = new ArrayList(size);
  for (int i = 0; i < size; i++) {
   items.add(defaultValue);
  }
 }

 public Row(int size) {
  this(size, "");
 }

 public List getItems() {
  return items;
 }

 public void setItems(List items) {
  this.items = items;
 }

 public int size() {
  return items.size();
 }
}




now in your ActionForm class:

 public List getDemandGrid() {
  return demandGrid;
 }

 public void setDemandGrid(List list) {
  demandGrid = list;
 }


in your action class setup the initial grid:

List demandGrid = new ArrayList(demandCount);
for (int i = 0; i < ?; i++) {
 demandRow = new Row(quarters.size(), "OFF");
 demandGrid.add(deamndRow);
}

form.setDemandGrid(demandGrid);




in your jsp:

<%
height = businessRevForecastForm.getDemandGrid().size();
width = ((Row) businessRevForecastForm.getDemandGrid().get(0)).size();
grid = businessRevForecastForm.getDemandGrid();
%>
<% for (int y = 0; y < height; y++) { %>

<% for (int x = 0; x < width; x++) { %>

<% } %>

<% } %>


after submit, form.getDemandGrid() list should be populated!

hope this helps.

ATTA

- Original Message - 
From: "Damien SAUVAGEOT" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 09, 2004 8:12 AM
Subject: Form with n columns and m raws


Hello,

I can't find how to implement a form which include n*m checkbox.
I would like to get :

doc1 doc2 doc3 ... docn
client1 x x x
client2 x x x
client 3 x x x
...
client m x x x x

I managed to get the form but I can't retrieve the values in the validate
function

private String[][] enveloppes;

in reset :
enveloppes = new String[n][m];
for(int i = 0; i < m; i++) {
for (int j=0; j < n; j++) {
enveloppes[j][i] = "off";
}
}
and for example, i get an array of 2*10 elements.
but when I check the size of enveloppes into the validate function, I get a
strange size of 1*1.

There is also the getter/setter :
/**
 * @return Returns the enveloppes.
 */
public String[][] getEnveloppes() {
return enveloppes;
}
/**
 * @param enveloppes The enveloppes to set.
 */
public void setEnveloppes(String[][] enveloppes) {
this.enveloppes = enveloppes;
}

Does anyone know the reason why the enveloppe size isn't 2*10?
I tried to log a lot of stuff and was not able to determine anything. The
setter is apparently never called.
I guess Struts is in charge of populating the form when it is sent back by
the browser.
I managed to use array of 1 dimension with struts form, even if I had quite
a hard time to figure out how to make it works but
I can't find any solution for 2 dimensions arrays.

the generated html corresponding parts are :

...




...

Thanks for the help,

Damien

-
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: Form action relative path

2004-07-07 Thread atta-ur rehman
How about:



ATTA

- Original Message - 
From: "toto2004b2000" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 07, 2004 1:34 AM
Subject: Form action relative path


> Hello,
> 
> My application is "toto" and with this struts tag
> 
> the generated HTML code is
> 
> 
> I need to use relative path (without application context), like
> 
> 
> Is it possible ? Any help would be appreciate.
> 
> Kind of regards
> 
> 
> 
> -
> 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: Submitting Indexed Properties and List Size/Resize

2004-07-06 Thread atta-ur rehman
Hello Dave,

I think you're pretty close! I don't see why do you have to resize the list
in the setter though? Here is what I've done and it works:

public BlockEffort getBlock(int index) {
  while (blockEffortList.size() <= index) {
   blockEffortList.add(new BlockEffort());
  }
  return (BlockEffort) blockEffortList.get(index);
 }

 public void setBlock(int index, BlockEffort block) {
  this.blockEffortList.add(index, block);
 }

Now, maybe more struts-knowledgable can add something to my 2 c!

ATTA

- Original Message - 
From: "Ellingson, David" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 06, 2004 12:21 PM
Subject: Submitting Indexed Properties and List Size/Resize


> I wanted to verify whether I am understanding the best way to submit
indexed
> properties to an ActionForm.
>
> I was originally having problems with ArrayOutOfBoundsExceptions when
> submitting the Form, and, after some research, it looks like the framework
> is expecting the List to be prepopulated before it can be populated with
the
> Request parameters.  While this can be done in the constructor, it seems
the
> best way is to dynamically resize the collection in both the get and set
> index methods.  For example, if a get() is called for index 10, and
records
> don't exist up to the 10th record, I can add the additional records up to
> the 10th element.  This works fine, but it seems a little awkward, so I
> wasn't sure if I am missing something here.
>
> Is this the best way to submit indexed properties to an ActionForm?
>
> Thanks,
> Dave
>
> -
> 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: Form tag problem

2004-07-05 Thread atta-ur rehman
okay, before i leave for the day, for path based mapping, you need  
something like:


controller
/do/

then all your urls must be like:
localhost/app/do/login
that's how i understand it. you may wanna have look at struts docos for  
this parameter.

ATTA
On Jul 5, 2004, at 4:57 PM, Erik Weber wrote:
Thanks for helping.
I assume you mean this part:

controller
/

The above code works (hooray), but if I try to change the url pattern  
to anything more specific (such as /login, or /login*, or /login/*) I  
get the wrong action parameter value . . .


atta-ur rehman wrote:
Okay, now you need to show your web.xml!
struts-config.xml looks fine. I'd suggest you try it with .do  
extension first and then try path mapping in web.xml

ATTA
On Jul 5, 2004, at 4:40 PM, Erik Weber wrote:















I have tried mapping the controller servlet to all kinds of path  
prefixes including "/login" and "/login/*" and "/". None of them  
result in the correct action parameter in the form. I don't want to  
use extension mapping. I want to use path mapping. Is this where the  
problem is?


atta-ur rehman wrote:
Hello Erik,
Is it possible for you to show your struts-config.xml file?
ATTA
On Jul 5, 2004, at 4:01 PM, Erik Weber wrote:
Could someone please tell me what would cause the html:form tag to  
ignore the value I specify to the action parameter, and instead,  
rewrite the action parameter value to be equal to the context root  
of the application?

For example, my web app login page is:
http://localhost:8080/Test/index.jsp
In login.jsp, I have this opening form tag:

I have a matching action configured in struts-config.xml. But the  
struts tag is rendering the form tag like this:


No matter what I try this does not change. This is extremely  
frustrating. Any help would be appreciated.

Erik
--- 
--
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]

-
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: Form tag problem

2004-07-05 Thread atta-ur rehman
Okay. this all i have in my web.xml and it works:

action
 
org.apache.struts.action.ActionServlet

  config
  /WEB-INF/struts-config.xml


  debug
  2


  detail
  2

2
  

  
  
action
*.do
  
hope this helps.
ATTA
On Jul 5, 2004, at 4:46 PM, Erik Weber wrote:
I should make one more correction. Actually when I mapped the  
controller Servlet to "/", the correct action parameter did show up in  
the form, and things worked correctly. However, I don't want to use  
"/" as my controller mapping -- I would rather do something more  
specific. But "/login" and "/login/*" for example don't work.

So again, I guess my question is still the same. Could someone explain  
how the action attribute relates to the controller Servlet mapping,  
and how I should use the  section to make this work  
correctly?

Thanks,
Erik

Erik Weber wrote:















I have tried mapping the controller servlet to all kinds of path  
prefixes including "/login" and "/login/*" and "/". None of them  
result in the correct action parameter in the form. I don't want to  
use extension mapping. I want to use path mapping. Is this where the  
problem is?


atta-ur rehman wrote:
Hello Erik,
Is it possible for you to show your struts-config.xml file?
ATTA
On Jul 5, 2004, at 4:01 PM, Erik Weber wrote:
Could someone please tell me what would cause the html:form tag to  
ignore the value I specify to the action parameter, and instead,  
rewrite the action parameter value to be equal to the context root  
of the application?

For example, my web app login page is:
http://localhost:8080/Test/index.jsp
In login.jsp, I have this opening form tag:

I have a matching action configured in struts-config.xml. But the  
struts tag is rendering the form tag like this:


No matter what I try this does not change. This is extremely  
frustrating. Any help would be appreciated.

Erik
 
-
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]

-
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: Form tag problem

2004-07-05 Thread atta-ur rehman
Okay, now you need to show your web.xml!
struts-config.xml looks fine. I'd suggest you try it with .do extension 
first and then try path mapping in web.xml

ATTA
On Jul 5, 2004, at 4:40 PM, Erik Weber wrote:















I have tried mapping the controller servlet to all kinds of path 
prefixes including "/login" and "/login/*" and "/". None of them 
result in the correct action parameter in the form. I don't want to 
use extension mapping. I want to use path mapping. Is this where the 
problem is?


atta-ur rehman wrote:
Hello Erik,
Is it possible for you to show your struts-config.xml file?
ATTA
On Jul 5, 2004, at 4:01 PM, Erik Weber wrote:
Could someone please tell me what would cause the html:form tag to 
ignore the value I specify to the action parameter, and instead, 
rewrite the action parameter value to be equal to the context root 
of the application?

For example, my web app login page is:
http://localhost:8080/Test/index.jsp
In login.jsp, I have this opening form tag:

I have a matching action configured in struts-config.xml. But the 
struts tag is rendering the form tag like this:


No matter what I try this does not change. This is extremely 
frustrating. Any help would be appreciated.

Erik
-
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]

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


Re: Form tag problem

2004-07-05 Thread atta-ur rehman
Hello Erik,
Is it possible for you to show your struts-config.xml file?
ATTA
On Jul 5, 2004, at 4:01 PM, Erik Weber wrote:
Could someone please tell me what would cause the html:form tag to 
ignore the value I specify to the action parameter, and instead, 
rewrite the action parameter value to be equal to the context root of 
the application?

For example, my web app login page is:
http://localhost:8080/Test/index.jsp
In login.jsp, I have this opening form tag:

I have a matching action configured in struts-config.xml. But the 
struts tag is rendering the form tag like this:


No matter what I try this does not change. This is extremely 
frustrating. Any help would be appreciated.

Erik
-
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] Netscape 7.1 WOW!

2004-06-30 Thread atta-ur rehman
I think Mozilla Firefox 0.9.1 would make you WOW! (all capitals!)

http://www.mozilla.org/products/firefox/

ATTA

- Original Message - 
From: "Michael McGrady" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, June 30, 2004 9:51 AM
Subject: [OT] Netscape 7.1 WOW!


> I have not used Netscape regularly for a while.  But, I just tried the
> newest Netscape 7.1 and I am really impressed.  Wow!  Speed, no crappy
ads,
> etc.  This is what I had hoped a browser would do!
>
> Michael
>
>
>
> -
> 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: Problem with displaying a subset of error messages using

2004-06-24 Thread atta-ur rehman
Okay, while out for lunch i thought about it and i think the right way of
doing it would be to use "property" attribute of the  tag:

http://jakarta.apache.org/struts/userGuide/struts-html.html#messages

henc new code:


   
  
   
  


I wish i could have been able to check it but let's see if it works!

ATTA

- Original Message - 
From: "Asif Rahman" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, June 24, 2004 1:26 PM
Subject: Re: Problem with displaying a subset of error messages using



> Hi Atta,  this is what I'm getting when I try that:
>
> javax.servlet.jsp.JspTagException: javax.servlet.jsp.JspException: An
error
> occurred while evaluating custom action attribute "test" with value
> "${error.key == 'company'}": Unable to find a value for "key" in object of
> class "java.lang.String" using operator "." (null)
>  at
org.apache.taglibs.standard.tag.el.core.IfTag.condition(IfTag.java:102)
>
> Any ideas?
>
> -Asif
>
> - Original Message - 
> From: "atta-ur rehman" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>; "Asif Rahman"
> <[EMAIL PROTECTED]>
> Sent: Thursday, June 24, 2004 4:04 PM
> Subject: Re: Problem with displaying a subset of error messages using
> 
>
>
> > Hello Asif,
> >
> > Now I havn't checked what I'm going to write here but am pretty sure it
> > should work.
> >
> > First of all while adding your ActionError to ActionErrors use 'company'
> as
> > the key for the company errors and 'factory' for factory related error
> > messages.
> >
> > like:
> >
> > ActionErrors errors = new ActionErrors();
> > errors.add('company', new ActionError());
> > errors.add('factory', new ActionError());
> >
> > now in you loop wrap you bean:wrie in an if statement:
> >
> > 
> >  
> > 
> > 
> > 
> >  
> >   
> > 
> >
> >
> > hope this work and helps!
> >
> > ATTA
> >
> > - Original Message - 
> > From: "Asif Rahman" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > Sent: Thursday, June 24, 2004 12:48 PM
> > Subject: Problem with displaying a subset of error messages using
> > 
> >
> >
> > Hi Im have been using pretty standard code to display error messages so
> far,
> > eg:
> >
> > 
> >  
> > 
> >  
> >   
> > 
> >
> >
> > But now, the problem I am facing is that I want to display a subset of
my
> > error messages in one part of page, (e.g. Error messages that start with
> > "Company") and the rest of the messages (ones that start with "Factory")
> in
> > another section of the page.  I've read the docs but really havent been
> able
> > to figure this one out.  Can someone plese help me?  Thanks.
> >
> > -Asif
> >
> >
> >
> > -
> > 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: Problem with displaying a subset of error messages using

2004-06-24 Thread atta-ur rehman
Hello Asif,

Now I havn't checked what I'm going to write here but am pretty sure it
should work.

First of all while adding your ActionError to ActionErrors use 'company' as
the key for the company errors and 'factory' for factory related error
messages.

like:

ActionErrors errors = new ActionErrors();
errors.add('company', new ActionError());
errors.add('factory', new ActionError());

now in you loop wrap you bean:wrie in an if statement:


 



 
  



hope this work and helps!

ATTA

- Original Message - 
From: "Asif Rahman" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, June 24, 2004 12:48 PM
Subject: Problem with displaying a subset of error messages using



Hi Im have been using pretty standard code to display error messages so far,
eg:


 

 
  



But now, the problem I am facing is that I want to display a subset of my
error messages in one part of page, (e.g. Error messages that start with
"Company") and the rest of the messages (ones that start with "Factory") in
another section of the page.  I've read the docs but really havent been able
to figure this one out.  Can someone plese help me?  Thanks.

-Asif



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



Re: [SOLVED] Re: Struts alternative to using request.getParameterValues in an actionform?

2004-06-17 Thread atta-ur rehman
You're welcome, Asif!

Now you why didn't I copy-pasted some code for you ;)

ATTA

- Original Message - 
From: "Asif Rahman" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, June 17, 2004 8:17 AM
Subject: [SOLVED] Re: Struts alternative to using request.getParameterValues
in an actionform?


> Thanks a million Atta-ur!! Indexed properties worked!  I tried using the
> struts nested tagblibs first, but couldnt get it to work with that, it
> seemed good only for display, but not retrieving objects into the
actionform
> from the jsp page when submitting.  Indexed properties definitely did the
> trick.  I found the following links helpful:
>
> http://www.mail-archive.com/[EMAIL PROTECTED]/msg96800.html
>
> and
>
> http://www.sudsy.net/technology/struts-advanced.html
>
>
> All I did with my code was
>
>
> JSP snippet:
>   ..
>   >
>
>  indexed="true" />
>
>  ...
>
> ActionForm snippet:
>
> public SitesDTO getSite(int index) {
>
> return (SitesDTO) sitesList.get(index);
>
> }
>
>
> public void setSite(int index, SitesDTO site) {
>
> this.sitesList.add(index,site);
>
> }
>
>
> where "site" in the logic:iterate has a matching "site" SiteDTO object in
> the actionform.
>
> -Asif
>
>
>
> - Original Message - 
> From: "atta-ur rehman" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>; "Asif Rahman"
> <[EMAIL PROTECTED]>
> Sent: Tuesday, June 15, 2004 5:14 PM
> Subject: Re: Struts alternative to using request.getParameterValues in an
> actionform?
>
>
> > Hellow Asif,
> >
> > "Indexed Properties" is exactly what you need here. For more info,
please
> > search thru the mail archive at:
> >
> > http://www.mail-archive.com/[EMAIL PROTECTED]/
> >
> > or at:
> >
> >
> > - Original Message - 
> > From: "Asif Rahman" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Tuesday, June 15, 2004 2:00 PM
> > Subject: Struts alternative to using request.getParameterValues in an
> > actionform?
> >
> >
> > Hi Im using  shown below to iterate through an arraylist
> > (sitesList) in my actionform (OpportunitySitesForm).  This arraylist
> > contains a number of Site objects which have the properties siteName,
> > address1, and city.  This is getting displayed correctly.  Now when
> > processing the form, I am wondering whether in struts there is a way to
> > retrieve these as objects and automatically populate
> setSitesList(ArrayList)
> > method, rather than manually use request.getParameterValues for
siteName,
> > address1, city, create individual Site objects, add the site objects to
an
> > arraylist  with Site objects and finally pass the list into
> > setSitesList(arraylist).
> >
> >  > property="sitesList" >
> >   
> >  > value=' />'>
> >  > value=' />'>
> > 
> >   
> > 
> >
> > Any help would be most appreciated.  Thanks!
> >
> > -Asif
> >
> >
> >
> > -
> > 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: Struts alternative to using request.getParameterValues in an actionform?

2004-06-15 Thread atta-ur rehman
okay, the other link was

http://jakarta.apache.org/struts/userGuide/building_view.html#indexed

hope this helps.

ATTA
- Original Message - 
From: "atta-ur rehman" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>; "Asif Rahman"
<[EMAIL PROTECTED]>
Sent: Tuesday, June 15, 2004 2:14 PM
Subject: Re: Struts alternative to using request.getParameterValues in an
actionform?


> Hellow Asif,
>
> "Indexed Properties" is exactly what you need here. For more info, please
> search thru the mail archive at:
>
> http://www.mail-archive.com/[EMAIL PROTECTED]/
>
> or at:
>
>
> - Original Message - 
> From: "Asif Rahman" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, June 15, 2004 2:00 PM
> Subject: Struts alternative to using request.getParameterValues in an
> actionform?
>
>
> Hi Im using  shown below to iterate through an arraylist
> (sitesList) in my actionform (OpportunitySitesForm).  This arraylist
> contains a number of Site objects which have the properties siteName,
> address1, and city.  This is getting displayed correctly.  Now when
> processing the form, I am wondering whether in struts there is a way to
> retrieve these as objects and automatically populate
setSitesList(ArrayList)
> method, rather than manually use request.getParameterValues for siteName,
> address1, city, create individual Site objects, add the site objects to an
> arraylist  with Site objects and finally pass the list into
> setSitesList(arraylist).
>
>  property="sitesList" >
>   
>  value=''>
>  value=''>
> 
>   
> 
>
> Any help would be most appreciated.  Thanks!
>
> -Asif
>
>
>
> -
> 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: Struts alternative to using request.getParameterValues in an actionform?

2004-06-15 Thread atta-ur rehman
Hellow Asif,

"Indexed Properties" is exactly what you need here. For more info, please
search thru the mail archive at:

http://www.mail-archive.com/[EMAIL PROTECTED]/

or at:


- Original Message - 
From: "Asif Rahman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 15, 2004 2:00 PM
Subject: Struts alternative to using request.getParameterValues in an
actionform?


Hi Im using  shown below to iterate through an arraylist
(sitesList) in my actionform (OpportunitySitesForm).  This arraylist
contains a number of Site objects which have the properties siteName,
address1, and city.  This is getting displayed correctly.  Now when
processing the form, I am wondering whether in struts there is a way to
retrieve these as objects and automatically populate setSitesList(ArrayList)
method, rather than manually use request.getParameterValues for siteName,
address1, city, create individual Site objects, add the site objects to an
arraylist  with Site objects and finally pass the list into
setSitesList(arraylist).


  



  


Any help would be most appreciated.  Thanks!

-Asif



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



Re: file upload problem(illegal argument)

2004-06-06 Thread atta-ur rehman
Hello there,

Does your  tag has attribute

enctype="multipart/form-data"

set?

HTH,

ATTA

- Original Message - 
From: "swarna" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, June 06, 2004 2:23 PM
Subject: file upload problem(illegal argument)


> Hi,
>   I am trying to do file upload using struts1.1. I am getting
> illegal argument type exception(stack trace attached below). I am
struggling
> to fix this since three days. I would really appreciate any kind of
> help.
>
> I am using web logic 8.1, eclipse and java for my development.
> I created a form with property type FormFile.
> jsp with input field 
>
> and a submit button. In action class I am just getting
> the file with form.getTheFile() method. but the problem is that when I
> hit submit button I am getting the following exception:
><[ServletContext(id=314
> 99063,name=cms-int-20040605,context-path=/cms-int-20040605)] Root cause
> of Servl
> etException.
> java.lang.IllegalArgumentException: argument type mismatch
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at
> org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(Property
> Utils.java:1789)
> at
> org.apache.commons.beanutils.PropertyUtils.setNestedProperty(Property
> Utils.java:1684)
> at
> org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.
> java:1713)
> at
> org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:101
> 9)
> at
> org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
> at
> org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252)
> at
> org.apache.struts.action.RequestProcessor.processPopulate(RequestProc
> essor.java:821)
> at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
> va:254)
> at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:148
> 2)
> at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
> weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
> (ServletStubImpl.java:971)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:402)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:305)
> at
> weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
> n.run(WebAppServletContext.java:6350)
> at
> weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
> dSubject.java:317)
> at
> weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
> 118)
> at
> weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
> rvletContext.java:3635)
> at
> weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
> pl.java:2585)
> at
> weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
> >
>
> Any help would be greately appreciated.
>
> thanks
>
>
>
>
> -
> Do you Yahoo!?
> Friends.  Fun. Try the all-new Yahoo! Messenger



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



Re: Can I use multibox with text fields?

2004-06-02 Thread atta-ur rehman
Hello Miguel,

You might want to search the archive for "indexed properties"; I think
that's what you're looking for.

HTH,

ATTA

- Original Message - 
From: "Miguel Arroz" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, June 02, 2004 4:04 PM
Subject: Can I use multibox with text fields?


> Hi!
>
>I need to display a page that loads a list of items from a DB, and
> that displays that list, with a text field and a checkbox per row. The
> checkbox is easy to do, using multibox. But how can I get the text
> field? Can I use something like multibox (and then read all the text
> boxes from an array), or do I have to do this manually (using iterate,
> etc)?
>
>Yours
>
> Miguel Arroz
>
>   Fire, walk with me.
>
>Miguel Arroz - [EMAIL PROTECTED] - http://www.guiamac.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: use of session object in Action Form?

2004-05-17 Thread atta-ur rehman
Hi,

As far as I know, both the reset() and validate() method are passed the
request object. You could get the session from this request object.

HTH,

ATTA

- Original Message - 
From: "Shyamal Shah" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, May 17, 2004 12:13 AM
Subject: use of session object in Action Form?


I need to use session object in my Action Form class. Can I use either
session or request object in my form class? If yes can someone please
suggest how can I do that?

Thanks,



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



Re: background process

2004-05-03 Thread atta-ur rehman
Hello Robert,

As far as I know Struts doen't provide anything like this. And actually it
should not!

You'd use Thread class to implement such a task that needs to return
immediately while running in the background.

Hope this helps.

ATTA

- Original Message - 
From: "Wei, Robert (MAN-Corporate)" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Monday, May 03, 2004 1:32 PM
Subject: background process


> Hi Folks,
>
> I need implement an action which sends back a forward upon request and
then,
> keep working on a batch process till finish in the background. Anyone
> familiar with an easy mechanism in struts 1.1? Thanks.
>
> Robert
>
> -
> 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]