Re: text field not populating after validate() fails.

2005-12-25 Thread Vikrama Sanjeeva
Hi,

 Ok I will read Rick's article. Right now situation is bit different
(I'm sure most of junior developers face more or less same situation). As
for me, I've certain deadline to achieve the functionality, which I have
achieved by just setting scope=session.

   Now as Rick said:

(nothing wrong with using the Session either but personally I don't think
you should use the Session for storing lists for form dropdowns.) 

At this stage, I'm more curious about the difference b/w two approaches.
Which one is more effecient (in terms of performance), reliable and
scalable. So that I can adopt the right approach for future struts based
development.

Thanks guys for discussing this topic.

Bye,
Viki.


On 12/24/05, Rahul Akolkar [EMAIL PROTECTED] wrote:

 On 12/24/05, Vikrama Sanjeeva [EMAIL PROTECTED] wrote:
  H,
   Rahul: The pull-down menus are prepopulated using the session. For
  pull-down menus, I'm using the same approach as Rick used in LESSON II
 - 9
  - Create SetUpEmployeeAction. You can see here:
  http://www.reumann.net/struts/lesson2/step9.do
 
 snip/

 OK, my question was about the text fields and textareas that were
 *not* getting populated after validation failure.

 But, please see Rick's pointer in the earlier email to this thread.

 -Rahul

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




pre-populating form fields when called in edit mode.

2005-12-25 Thread Vikrama Sanjeeva
Hi,

Here is the sequence:

1: User fill up's employeeForm.jsp which have multiple text fields, radio
buttons, text area's and dropdowns.
2: On pressing Submit button in employeeForm.jsp, InsertEmployeeAction
is called which  do the following:

 2.1) BeanUtils.copyProperties( employeeDTO, employeeForm)
 2.2) DataBaseService.insertEmployee (employeeDTO)
 2.3) return mapping.findForward(success);

 Now, I want to call same employeeForm.jsp in editable mode, such that
all the fields (text fields, radio buttons, text area's and dropdowns) are
pre-populated. What approaches are there to achieve this? I'm looking for
a way which uses same  BeanUtils.copyProperties() and copy the employeeDTO
to employeeForm (Bean). Something like this:

  When user click's Edit Employee Form link, an action
(EditEmployeeAction) will be called. Which will do the following:

1. Fetch the employee information from database in employeeDTO.
2. Get the handle of EmployeeForm (ActionForm), lets say employeeForm
3. BeanUtils.copyProperties(employeeForm, employeeDTO)
4. return mapping.findForward(editMode);

  I'm not sure whether this approach will work or not? And whether I have to
make seprate JSP's for 1st time fill up (employeeForm.jsp) and edit mode (
employeeFormEdit.jsp). If this the case, then I guess, I've to make
EmployeeFormEdit.java  (ActionForm) as well.

  It will be great if anybody could help me here.

Thanks in advance.

Bye,
Viki.


Tiles ignore=true problem

2005-12-25 Thread Keith C. Klopfer
Hello,

Since migrating to Tomcat 5.5.9 (from 5.0.28) and JDK 5.0, I've been getting a 
Tiles error that I can't seem to get past.  Tiles seems to not be recognizing 
the ignore=true parameter in the tiles:get tags.  I get an error stating:

The requested resource /tile2 is not available

when I don't define tile2 in my tiles-def.xml.  A snippet of my get tags is 
below:

td id=leftcolumn 
tiles:get name=tile1 ignore=true /
tiles:get name=tile2 ignore=true /
/td

A snippet of the defs:

definition name=.admin.gettip extends=.admin.base
put name=tile1 value=/main/front1.jspf/ 
put name=breadcrumbs type=string Admin -- Edit Tip/put
/definition

Again, when I don't define tile2, I get the is not available error.  I'm 
not sure why the ignore tag is no longer working after upgrading to Tomcat 
5.5.9 and JDK 5.0.

Any suggestions are greatly appreciated.

Thanks,

KK

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



Re: Back Button Problem..

2005-12-25 Thread Srinivasu Gandu
why don't you make your session to false. That should take care of it.

Srinivas Jadcharla [EMAIL PROTECTED] wrote:  You can find some documentation 
in Jakarta Struts 1.1(Wrox Series.) abt how
to use Tokens , but iam not sure how far it is helpful to solve your problem

On 12/19/05, Priya Saloni wrote:

 Here is my Code,

 request.getSession().removeAttribute(sessionState);
 request.getSession().invalidate();
 response.sendRedirect(/BMS/logout_success.jsp);

 It invalidates properly but when i hit back button its asking to
 resubmit.Iread it some where that by implementing Tokens we can avoid
 this
 problem.Any one have idea where i can get the example application to work
 with Transaction Tokens..

 Thanks

 Priya

 On 12/16/05, Martin Gainty wrote:
 
  just as a quick sanity check
 
  HTTPSession strSession = request.getSession(false);
  strSession.removeAttribute(sessionState);
 
  strSession = session.getId();
  while(strSession != null)
  { //session information is still there
  session.invalidate();
  strSession = session.getId();
  }
  response.sendRedirect(/BMS/logout_success.jsp);
 
  //To clear the cache I would place these meta-commands in the head
  must-revalidate


 
  Then again that message appears to be specific to IE on XP SP2
  http://support.microsoft.com/default.aspx?scid=kb;en-us;890178
 
  Anyone else?
  M-
 
  - Original Message -
  From: Priya Saloni 
  To: Struts Users Mailing List 
  Cc: Garner, Nigel M 
  Sent: Friday, December 16, 2005 1:46 PM
  Subject: Re: Back Button Problem..
 
 
  Thanks for your time.But i can't use Appuse at this time because my
  project
  ready for production(Except this problem).
 
  Priya
 
 
  On 12/16/05, Garner, Nigel M wrote:
  
   You could always use a ServletFilter to make sure that users never
 have
   access to pages that you don't want them to. By checking for a user
   object or something like the sessionState object then you could
   determine whether or not the user is logged in. If not then it will
   allow you to redirect the user to where ever you want.
  
   I have used them on a number of occasion for this purpose and I think
   the struts appfuse projected (see struts.sourceforge.net) provide a
   downloadable implementation.
  
   Thanks
   Nigel
  
   -Original Message-
   From: Priya Saloni [mailto:[EMAIL PROTECTED]
   Sent: 16 December 2005 14:49
   To: Struts Users Mailing List
   Subject: Back Button Problem..
  
   Hi there,
  
   I facing a BIG problem in my struts based application.When i logout my
   website and hit back button it showing a page like the following
  
   //
   Warning: Page has Expired
   The page you requested was created using information you submitted in
 a
   form. This page is no longer available. As a security precaution,
   Internet Explorer does not automatically resubmit your information for
   you.
  
   To resubmit your information and view this Web page, click the
   *Refresh*button.
  
  
   //
  
   When i refresh the page its showing the secured web pages too.My code
 in
   LogoutAction is as follows
  
   request.getSession().removeAttribute(sessionState);
   request.getSession().invalidate();
   response.sendRedirect(/BMS/logout_success.jsp);
  
   sessionState is the VO where iam keeping all the objects i want to
 keep
   in session..Is there any way in struts to make sure that it won't
   display the page like above..
  
   Thanks
  
   Priya.
  
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 




--
Thanks  RegardsSrinivas732-648-9421(Cell)




Thanks!
Have a great day!!
Srini

-
Yahoo! Photos
 Ring in the New Year with Photo Calendars. Add photos, events, holidays, 
whatever.

Re: Same action with multiple submit buttons

2005-12-25 Thread Srinivasu Gandu
how funny is that.. why do you want to give the same name to all of your 
buttons??

Pazhanikanthan Periasamy [EMAIL PROTECTED] wrote:  Have a hidden attribute 
called method.

Assign this param with the method name u need to call in the 
DispatchAction Class based on the Button you have clicked and submit the 
form.

Thanks and regards,
Pazhanikanthan. P
Project Leader,
Caritor (India) Pvt. Ltd.,
Madras - 600 006
Mob: 9886152717
Extn: 40123



Shiby Maria John 
12/21/2005 03:02 PM
Please respond to
Struts Users Mailing List 


To
Struts Users Mailing List 
cc

Subject
Same action with multiple submit buttons







Hi,
Thnaks for the tip reg LookupDispatchAction, but the problem is that I
have the same name for different buttons in the same form.
In that case, how will I know which button submitted that action??




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






Thanks!
Have a great day!!
Srini

-
Yahoo! Shopping
 Find Great Deals on Holiday Gifts at Yahoo! Shopping