SSL with Struts/Tomcat

2002-12-09 Thread Tuan H. Le
Hi,

Sorry, I think this question is more related to Tomcat and F5 load balancer instead of 
Struts related topic. But, I'm hoping that some one on this group has done/configured 
a similar environment like we have and point me to a direction on how to solve our 
problem with HTTPS.

We are using Big IP 2000 application switches controller running config 4.2 PTF7.
Basically, the problem is when HTTPS session is initiated (by requesting /abc/login.do 
servlet and it works fine), but the links or redirects within the page is sending the 
session back to an HTTP none secure session. SSL redirection and rewrite are 
configured on the F5 and seem to be working on pages without frames. However, for this 
particular site using frame pages, it does not appear to be working properly. 
Thanks,
Tuan





<>--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: html:multibox values not populated in the form bean

2002-12-03 Thread Tuan H. Le
I figured out one of my problems. Now, it calls the setter method in a form bean, but 
when it gets to the action class, the String[] variable for storing multibox selection 
is empty. Do you know what I'm missing?

Thanks,
Tuan

>  -Original Message-
> From:         Tuan H. Le  
> Sent: Tuesday, December 03, 2002 9:42 AM
> To:   Struts Users Mailing List (E-mail)
> Subject:  html:multibox values not populated in the form bean
> 
> Hi,
> 
> I'm having a problem that the setter method in the form bean does not get called 
>when I submit an HTML form with a  to an action class.
> 
> I read some of previous related posts in the archives, but I couldn' t find a 
>solution to this problem. Please advise on how to troubleshoot this problem. Thanks!
> 
> Here's my code
> 
> --- JSP code ---
> 
> name="approveSubmitForm"
>type="com.phs.ezhr.presentation.form.ApproveSubmitForm"
>method="post"
>target="_parent">
> ...
> 
> 
>   type="com.phs.ezhr.business.vo.EmployeeVO" indexId="idx" offset="offset" length="25" 
>>  
> 
>   onclick='selectChoice( this.form, this )'>
>   
> 
> ...
> 
> 
> 
> 
> 
> 
> -- Generated HTML code -
> 
> target="_parent">value="3eaa663392c1d65f7d5dbcd81f5498a4">
> 
> 
> 
>  
> 
>   
>   
>   
> 
> 
>   
> 
>  
> 
> ...
> 
>  Form bean --
> 
> 
>   private String[] approveList;
> 
>   /**
>* Set the approve checkbox list array
>* @param anApproveList
>*/
>   public void setApproveList( String[] anApproveList ) {
> System.out.println( "Setter method for approve list get 
>called!!" );
> this.approveList = anApproveList;
>   }
> 
>   public String[] getApproveList() {
> return this.approveList;
>   }
> 
>   public void reset( ActionMapping mapping,
>  HttpServletRequest request ) {
> 
>   }
> 
> 
> 
>  << File: ATT43476.txt >> 

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




html:multibox values not populated in the form bean

2002-12-03 Thread Tuan H. Le
Hi,

I'm having a problem that the setter method in the form bean does not get called when 
I submit an HTML form with a  to an action class.

I read some of previous related posts in the archives, but I couldn' t find a solution 
to this problem. Please advise on how to troubleshoot this problem. Thanks!

Here's my code

--- JSP code ---


...


   
 

  
  

...






-- Generated HTML code -





 


  

    

  

 

...

 Form bean --


  private String[] approveList;

  /**
   * Set the approve checkbox list array
   * @param anApproveList
   */
  public void setApproveList( String[] anApproveList ) {
System.out.println( "Setter method for approve list get 
called!!" );
this.approveList = anApproveList;
  }

  public String[] getApproveList() {
return this.approveList;
  }

  public void reset( ActionMapping mapping,
 HttpServletRequest request ) {

  }





<>--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: intermitten missing field value when submit to a Struts action????

2002-12-02 Thread Tuan H. Le
Andrew,

Thanks for your response! 

I changed the field name from action to dispatch, but I got the same result, and I'm 
having the same problem on the   as well (my previous post 
" having a problem of passing the selected items to an action").

Thanks,
Tuan

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 6:19 PM
To: Struts Users Mailing List
Subject: RE: intermitten missing field value when submit to a Struts
action


Is it just for parameters named "action" or for other parameters as well?
In JavaScript forms have a property "action" that contains the url of where
to submit the form on a post. You may be experiencing some interference? -
Though in my experience it usually seems to work the other way. Ie: the
field hides the property...
Worth a try using a name other than action though.

-Original Message-
From: Savantraj, Chennamakal Subramanian [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 03, 2002 09:44
To: 'Struts Users Mailing List'
Subject: RE: intermitten missing field value when submit to a Struts
action


May look funny but pls check the spelling of method="post". We had this
problem and later found that methd="post".
Great possibility of overlooking this.

-Original Message-
From: Tuan H. Le [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 03, 2002 9:43 AM
To: Struts Users Mailing List
Subject: RE: intermitten missing field value when submit to a Struts
action


Todd,

I'm using POST method in my form.

Thanks,
Tuan

-Original Message-
From: Todd Pierce [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 5:22 PM
To: Struts Users Mailing List
Subject: RE: intermitten missing field value when submit to a Struts
action


If you have something working consistently in one browser and consistently
not in another, it's likely to be an HTML problem. Are you submitting with a
GET or a POST method? If you're using GET, there's a known bug (fixed in IE
6) where parameter names can resolve to escape characters, e.g.
/someul.do?param=123"e=456 will become /someul.do?param=123"e=456. Might
be something to do with that?



-Original Message-
From: Tuan H. Le [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 3 December 2002 10:28 AM
To: Struts Users Mailing List
Subject: RE: intermitten missing field value when submit to a Struts
action


Edgar,

Thanks for your replied. I also tried to set the action in a Struts form
bean and I got the same result. It worked fine with IE 6.0.

Thanks,
Tuan

-Original Message-
From: edgar [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 3:25 PM
To: 'Struts Users Mailing List'
Subject: RE: intermitten missing field value when submit to a Struts
action


This doesn't sound like a browser issue.  I would look elsewhere.

Edgar

-Original Message-
From: Tuan H. Le [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 6:05 PM
To: 'Struts Users Mailing List (E-mail)'
Subject: intermitten missing field value when submit to a Struts
action


Hi,

Has any one experienced a problem that I'm having with hidden input text
field?

I have two different IE browser versions (5.5 and 6.0). For the IE 6.0,
it works fine when I get a hidden field value via

(String)request.getParameter( "action" );

But, for IE 5.5 version with the same code, some times it returns a null
value from the hidden field action.

Thanks,
Tuan







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


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


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

---
This email is confidential and intended only for the use of the individual
or entity named above and may contain information that is privileged. If you
are not the intended recipient, you are notified that any dissemination,
distribution or copying of this email is strictly prohibited. If you have
received this email in error, please notify us immediately by return email
or telephone and destroy the original message. Thank you. - This mail is
sent via Sony Asia Pacific Mail Gateway.
---


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


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


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




RE: intermitten missing field value when submit to a Struts action????

2002-12-02 Thread Tuan H. Le
Todd,

I'm using POST method in my form.

Thanks,
Tuan

-Original Message-
From: Todd Pierce [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 5:22 PM
To: Struts Users Mailing List
Subject: RE: intermitten missing field value when submit to a Struts
action


If you have something working consistently in one browser and consistently
not in another, it's likely to be an HTML problem. Are you submitting with a
GET or a POST method? If you're using GET, there's a known bug (fixed in IE
6) where parameter names can resolve to escape characters, e.g.
/someul.do?param=123"e=456 will become /someul.do?param=123"e=456. Might
be something to do with that?



-----Original Message-
From: Tuan H. Le [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 3 December 2002 10:28 AM
To: Struts Users Mailing List
Subject: RE: intermitten missing field value when submit to a Struts
action


Edgar,

Thanks for your replied. I also tried to set the action in a Struts form
bean and I got the same result. It worked fine with IE 6.0.

Thanks,
Tuan

-Original Message-
From: edgar [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 3:25 PM
To: 'Struts Users Mailing List'
Subject: RE: intermitten missing field value when submit to a Struts
action


This doesn't sound like a browser issue.  I would look elsewhere.

Edgar

-Original Message-
From: Tuan H. Le [mailto:[EMAIL PROTECTED]] 
Sent: Monday, December 02, 2002 6:05 PM
To: 'Struts Users Mailing List (E-mail)'
Subject: intermitten missing field value when submit to a Struts
action


Hi,

Has any one experienced a problem that I'm having with hidden input text
field? 

I have two different IE browser versions (5.5 and 6.0). For the IE 6.0,
it works fine when I get a hidden field value via

(String)request.getParameter( "action" );

But, for IE 5.5 version with the same code, some times it returns a null
value from the hidden field action.

Thanks,
Tuan







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


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


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




having a problem of passing the selected items to an action

2002-12-02 Thread Tuan H. Le

Hi,

I'm having a problem of getting the selected checkbox values in my Struts action 
class. In the view, it has two multiboxes (approve and reject) and in my Struts form 
class I declared two String[] attributes to hold the selected checkbox values. But, 
when it gets to the action via html form submit, it returns empty String array. The 
checkbox selection works fine on the view.

Below is my code: View, ActionForm, Action class, and strut-config.xml.

Thanks for your time!

Tuan

- View (JSP) -

  Online Focal Tool Application
  
  
   function check( e ) {
  e.checked = true;
   }

   function clear( e ) {
  e.checked = false;
   }

   function checkAll( selectedChkBoxName ) {
  // clear the other selections
  if ( selectedChkBoxName == 'approveList' ) {
// clear reject check box list
clearAll( 'rejectList' );
  } else {
// clear approve check box list
clearAll( 'approveList' );
  }
  // now, set the user's selections
  var listForm = top.frames['body'].approveSubmitForm;
  var len = listForm.elements.length;
  for ( var i = 0; i < len; i++ ) {
 var e = listForm.elements[i];
 if ( e.name == selectedChkBoxName ) {
check( e );
 }
  }
   }

   function isNumeric (content) {
 if (((content/content) != 1) && (content != 0)) {
   return false;
 } else {
   return true;
 }
   }

   function clearAll( selectedChkBoxName ) {
  // now, un-select the user's selections
  var listForm = top.frames['body'].approveSubmitForm;
  var len = listForm.elements.length;
  for ( var i = 0; i < len; i++ ) {
 var e = listForm.elements[i];
 if ( e.name == selectedChkBoxName ) {
clear( e );
 }
  }
   }

   function selectChoice( theForm, theField ) {
 var len = theForm.elements.length;
 for ( var i = 0; i < len; i++ ) {
   if ( theForm.elements[i].type == 'checkbox' ) {
 if ( theForm.elements[i].name != theField.name ) {
   if (( theForm.elements[i].value == theField.value) && 
theForm.elements[i].checked ) {
 clear( theForm.elements[i] );
 break;
   } else if ( theForm.elements[i].value == theField.value ) {
 // found a match, but the other checkbox is not selected, so
 // break out this loop
 break;
   }
 }
   }
 } // end for
   }
   





...


   
   

  
  


  
  
 

...
  


...


-- User Form class -

public final class ApproveSubmitForm extends ActionForm {

  private String[] approveList;
  private String[] rejectList;

  /**
   * Set the approve checkbox list array
   * @param anApproveList
   */
  public void setApproveList( String[] anApproveList ) {
this.approveList = anApproveList;
  }

  public String[] getApproveList() {
return this.approveList;
  }

  /**
   * Set the reject checkbox list array
   * @param aRejectList
   */
  public void setRejectList( String[] aRejectList ) {
this.rejectList = aRejectList;
  }

  public String[] getRejectList() {
return this.rejectList;
  }

  /**
   * Reset method is run after every HTML submit and before the action
   * class takes over.
   * @param mapping
   * @param request
   */
  public void reset( ActionMapping mapping,
 HttpServletRequest request ) {
  }

  /**
   * Validate method is run after every HTML submit and before the actio
   * class takes over.
   * @param mapping
   * @param request
   * @return
   */
  public ActionErrors validate( ActionMapping mapping,
HttpServletRequest request ) {
ActionErrors errors = new ActionErrors();

return errors;
  }
}



-- User Action class --


...

  public ActionForward perform( ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response )
throws IOException, ServletException {


  /**
   * get the user's approval selection list and process the request
   */
  String[] approveList = (String[])approveSubmitForm.getApproveList();
  if ( approveList != null && approveList.length > 0 ) {
   

  }

  /**
   * get the user's reject selection list and process the request
   */
  String[] rejectList = (String[])approveSubmitForm.getRejectList();
  if ( rejectList != null && rejectList.length > 0 ) {


  }
   ...
   }

}


struts-config.xml -

...

  

  




   

RE: intermitten missing field value when submit to a Struts action????

2002-12-02 Thread Tuan H. Le
Edgar,

Thanks for your replied. I also tried to set the action in a Struts form bean and I 
got the same result. It worked fine with IE 6.0.

Thanks,
Tuan

-Original Message-
From: edgar [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 3:25 PM
To: 'Struts Users Mailing List'
Subject: RE: intermitten missing field value when submit to a Struts
action


This doesn't sound like a browser issue.  I would look elsewhere.

Edgar

-Original Message-----
From: Tuan H. Le [mailto:[EMAIL PROTECTED]] 
Sent: Monday, December 02, 2002 6:05 PM
To: 'Struts Users Mailing List (E-mail)'
Subject: intermitten missing field value when submit to a Struts
action


Hi,

Has any one experienced a problem that I'm having with hidden input text
field? 

I have two different IE browser versions (5.5 and 6.0). For the IE 6.0,
it works fine when I get a hidden field value via

(String)request.getParameter( "action" );

But, for IE 5.5 version with the same code, some times it returns a null
value from the hidden field action.

Thanks,
Tuan







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


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




intermitten missing field value when submit to a Struts action????

2002-12-02 Thread Tuan H. Le
Hi,

Has any one experienced a problem that I'm having with hidden input text field? 

I have two different IE browser versions (5.5 and 6.0). For the IE 6.0, it works fine 
when I get a hidden field value via

(String)request.getParameter( "action" );

But, for IE 5.5 version with the same code, some times it returns a null value from 
the hidden field action.

Thanks,
Tuan





<>--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


invokes processActionForward twice when submit????

2002-11-26 Thread Tuan H. Le
Hi,

I have noticed that when we submit an HTML form to a Struts action servlet, it called 
processActionForward twice. Is it possible? If so, how do we prevent it?

Thanks,
Tuan


<>--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


data in session sometimes not get updated???

2002-11-07 Thread Tuan H. Le
Hi,

I'm having a bug in my application that the user's session attribute SOMETIMES does 
not get updated/refreshed as expected, but I don't know the reason why. Please advise 
what I'm doing wrong. Here is my test scenario

1) UserAction class fetches a list of employees with review status and store the list 
in an ArrayList
2) UserAction class set this ArrayList object in a session attribute
3) UserAction class forwards to a view
4) A view uses above ArrayList object in session to display a list of employees with 
their review status (reject/approve)
5) The user selects one or more employees and submit for approval or/and rejection
6) UserAction class saves the employee(s) review status
7) UserAction class rebuilds the ArrayList by fetching from a database
8)  same as step 2
9)  same as step 3
10)  same as step 4

I debugged the code and I found that the data get saved correctly in step 6 and 
returned with updated values in step 7. But, SOMETIMES that data in a session 
attribute does not get updated. If I refresh browser window, it displays the new 
updated data.


Here's my code snippet

### UserAction class ##

  . . .
  // get a list of employees. Returns an array list of EmployeeVO objects
  List employeeList = employeeDAO.getEmployeeReviewList( manager.getEmployeeId() );

  // make sure to destroy previous employeeList object before setting a new one
  List tmpObj = (List)session.getAttribute( USER_EMPLOYEE_LIST_VIEW_KEY );
  tmpObj = null;
  // now set the object in a session attributes
  session.setAttribute( USER_EMPLOYEE_LIST_VIEW_KEY, employeeList );
  . . .

 Value Object ###

/**
 * The Value Object will be placed in the session; therefore it needs to be
 * serializable so the container can persist sessions if needed.
 */
public class EmployeeVO extends PersonVO implements Serializable {
. . .
}

 JSP View 


<%
  // number of employees returned from the list
  if ( employeeList != null ) {
int listSize = employeeList.size();
  }
%>



  
  
  
  
<%@ include file="CommonJSFunctions.js"%>
  







  
  ">
  // --
  // output employee data with review status here.
  // I'm using JSP scripting instead of  tag
  // Could this have any conflicts?? Below is a sample code
  // --
  
<%= employee.getReviewStatus() %>
  
  







<>--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: Missing Struts Form attributes in Action class

2002-11-05 Thread Tuan H. Le
Edgar,

Thanks for your response! I commented out the code in reset() method, but still get 
null data in the Action class for action and view attributes. 

  public void reset( ActionMapping mapping,
 HttpServletRequest request ) {
//action = null;
//view = null;
  }

Please advise.

Thanks,
Tuan

-Original Message-
From: edgar [mailto:edgar@;blue-moose.net]
Sent: Tuesday, November 05, 2002 1:39 PM
To: 'Struts Users Mailing List'
Subject: RE: Missing Struts Form attributes in Action class


Reset and validate are run after every html submit and before the action
class takes over.

-Original Message-----
From: Tuan H. Le [mailto:tuan.le@;phsadc.com] 
Sent: Tuesday, November 05, 2002 4:30 PM
To: 'Struts Users Mailing List (E-mail)'
Subject: Missing Struts Form attributes in Action class


Hi, 

Do you know of the reason why in my case the form data in Struts Form
class does not get passed to the Action class? When the user clicks on a
Submit button, I need to set the value in the action and view hidden
fields, and submit that HTML form to a Struts Action class. But for some
reasons, when I retrieve the data from the Struts Form, it returned
null. 

Below is my code and Struts config file for that form. 

Thanks!
Tuan

 struts-config.xml -








 Form class -

public final class ApproveSubmitForm extends ActionForm
 implements IConstants {
  /**
   * User's selected view
   */
  private String view;
  /**
   * submit action
   */
  private String action;

  public void setView( String aView ) {
this.view = aView;
  }

  public String getView() {
return this.view;
  }

  public void setAction( String anAction ) {
this.action = anAction;
  }

  public String getAction() {
return this.action;
  }

  public void reset( ActionMapping mapping,
 HttpServletRequest request ) {
action = null;
view = null;
  }

  public ActionErrors validate( ActionMapping mapping,
HttpServletRequest request ) {
ActionErrors errors = new ActionErrors();

return errors;
  }
}

- Action class  ---

public final class ApproveSubmitAction extends Action
   implements IConstants {
  public ActionForward perform( ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response )
throws IOException, ServletException {

///
// ... other code logic
//

// get the form handler
ApproveSubmitForm approveSubmitForm = (ApproveSubmitForm)form;

// PROBLEM: both of these variables returned null
String selectedView = approveSubmitForm.getView();
String selectedAction = approveSubmitForm.getAction();

// Forward to the appropriate View
return ( mapping.findForward( target ) );
  }
}



- JSP (View) --



  function saveApproveReject( theForm ) {
 theForm.view.value =
theForm.view.options[theForm.view.selectedIndex].value;
 theForm.action.value = 'submit';
 theForm.submit();
  }










--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>




Missing Struts Form attributes in Action class

2002-11-05 Thread Tuan H. Le
Hi, 

Do you know of the reason why in my case the form data in Struts Form class does not 
get passed to the Action class? When the user clicks on a Submit button, I need to set 
the value in the action and view hidden fields, and submit that HTML form to a Struts 
Action class. But for some reasons, when I retrieve the data from the Struts Form, it 
returned null. 

Below is my code and Struts config file for that form. 

Thanks!
Tuan

 struts-config.xml -








 Form class -

public final class ApproveSubmitForm extends ActionForm
 implements IConstants {
  /**
   * User's selected view
   */
  private String view;
  /**
   * submit action
   */
  private String action;

  public void setView( String aView ) {
this.view = aView;
  }

  public String getView() {
return this.view;
  }

  public void setAction( String anAction ) {
this.action = anAction;
  }

  public String getAction() {
return this.action;
  }

  public void reset( ActionMapping mapping,
 HttpServletRequest request ) {
action = null;
view = null;
  }

  public ActionErrors validate( ActionMapping mapping,
HttpServletRequest request ) {
ActionErrors errors = new ActionErrors();

return errors;
  }
}

- Action class  ---

public final class ApproveSubmitAction extends Action
   implements IConstants {
  public ActionForward perform( ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response )
throws IOException, ServletException {

///
// ... other code logic
//

// get the form handler
ApproveSubmitForm approveSubmitForm = (ApproveSubmitForm)form;

// PROBLEM: both of these variables returned null
String selectedView = approveSubmitForm.getView();
String selectedAction = approveSubmitForm.getAction();

// Forward to the appropriate View
return ( mapping.findForward( target ) );
  }
}



- JSP (View) --



  function saveApproveReject( theForm ) {
 theForm.view.value = theForm.view.options[theForm.view.selectedIndex].value;
 theForm.action.value = 'submit';
 theForm.submit();
  }








<>--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE:

2002-11-04 Thread Tuan H. Le
David,

Thanks for your response! In our app, it's required to have select all and deselect 
all features. I'm not sure that radio buttons can fullfil this requirement. Am I right?

Thanks,
Tuan

-Original Message-
From: David Graham [mailto:dgraham1980@;hotmail.com]
Sent: Monday, November 04, 2002 6:00 PM
To: [EMAIL PROTECTED]
Subject: Re: 


This behavior is easily acheived by using radio buttons instead of 
checkboxes.  Is that an option?

David






>From: "Tuan H. Le" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: "Struts Users Mailing List (E-mail)" <[EMAIL PROTECTED]>
>Subject: 
>Date: Mon, 4 Nov 2002 17:54:17 -0800
>
>Hi,
>
>I need to pass in the select box index to a JavaScript function. Is there a 
>way to do that in  tag?. I have tried JSP scripting 
>(<%=...%>), but that does not work. I have two multiboxes in a form and I 
>need to select/unselect the checkbox between those two multiboxes via 
>calling my selectChoice() JS function below
>
>JavaScript:
>
>function selectChoice( field, i ) {
>   if ( field[i].checked == true ) {
>  // unselect other check box index
>   }
>}
>
>JSP:
>
>
>   length="25" offset="<%= ""+count %>">
>   
> 
>   onclick="selectChoice( this.form.rejectList, <<<INDEX HERE>>>> )">
>  
>   
> 
>   
>   
>
>
>Thanks,
>Tuan
><< winmail.dat >>
>--
>To unsubscribe, e-mail:   
><mailto:struts-user-unsubscribe@;jakarta.apache.org>
>For additional commands, e-mail: 
><mailto:struts-user-help@;jakarta.apache.org>


_
Unlimited Internet access -- and 2 months free!  Try MSN. 
http://resourcecenter.msn.com/access/plans/2monthsfree.asp


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>




struts-user@jakarta.apache.org

2002-11-04 Thread Tuan H. Le
Hi,

I need to pass in the select box index to a JavaScript function. Is there a way to do 
that in  tag?. I have tried JSP scripting (<%=...%>), but that does not 
work. I have two multiboxes in a form and I need to select/unselect the checkbox 
between those two multiboxes via calling my selectChoice() JS function below

JavaScript:

   function selectChoice( field, i ) {
  if ( field[i].checked == true ) {
 // unselect other check box index
  }
   }

JSP:


  ">


  
 
  

  
  


Thanks,
Tuan

<>--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Close a child window and refresh its parent window

2002-10-23 Thread Tuan H. Le
Hi,

I recalled that some one on this forum posted a similar problem that I'm having with 
the child-parent window issue which is more related to JavaScript. But, I couldn't 
find a solution to my issue in this forum's archive.

In my app, I need to:

1) submit the form to a specified action and save the data in db
2) close the child window (a modal window) 
3) and refresh its parent window with the updated data in db

I tested my code and it saved the data in the child window after invoking the action 
serlvet. But, after it closed the child window, it opened a new window instead of 
refreshing its parent window. The new window has the same layout and data as the 
parent window, hence, it get duplicated.

If some one has implemented this functionality in JavaScript, may I ask for your time 
to correct the doSave() JavaScript below so that the parent window would get refreshed.

Thanks a bunch!

Tuan


- MainMenu.jsp (frameset) : JSP Code for Parent window -



  

function openModal( theURL, name ){
  window.showModalDialog( theURL, '' ,'dialogWidth:662px;, dialogHeight:180px; 
help:no; scroll:no; status:no; center:yes; resizable:no; unadorned:yes;');
}

  

  
  

  

   

  




--- EditSalary.jsp: JSP Code for child (popup Modal window) --



  
function doSave() {
  //
  // need code to close the child window and refresh the 
  // parent window which opened the child window
  // 
  // call form.submit() here and close the child window
  // self.close();
  //
}
  

  

 

  




 struts-config action mapping ---


















<>--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: with JavaScript

2002-10-23 Thread Tuan H. Le
David,

Thanks! I will try your suggestion shortly.

Tuan

-Original Message-
From: Karr, David [mailto:david.karr@;attws.com]
Sent: Tuesday, October 22, 2002 11:29 AM
To: 'Struts Users Mailing List'
Subject: RE:  with JavaScript


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:Jeff_Mychasiw@;nlgroup.ca]
> Sent: Tuesday, October 22, 2002 11:02 AM
> 
> Try:
>="com.abc.EmployeeVO" ...>
>   
>onclick="openModal('/editSalary.do?<%
>   = employee.getId() %>')">   height="18" border="0" alt="edit">
>   
> 

This won't quite work.  If you use a scriptlet for the rtexprvalue of an
attribute, it has to be the ENTIRE attribute value, not just a portion of
it.  So, your "onclick" attribute would look approximately like this:

onclick='<%= "openModal(\'/editSalary.do?" + employee.getId() + ")"\')'

Bleah.  I wouldn't be surprised if I got some quoting wrong there.

If you use the Struts-EL package in the nightly build, this is much easier,
and would look like this:

onclick="openModel('/editSalary.do?${employee.id}')"

However, even this probably isn't right.  I think you intended to have a
request parameter and a value, but you appear to be just sending a request
parameter name with no value.  Therefore, you might have instead intended
something like this (in the easier struts-el syntax):

onclick="openModel('/editSalary.do?id=${employee.id}')"

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: with JavaScript

2002-10-22 Thread Tuan H. Le
ok, I replaced  with  and it works fine. It seems like the 
scriptlet <%=%> can not be parsed within the  tag.

Thanks!
Tuan

-Original Message-
From: Tuan H. Le 
Sent: Tuesday, October 22, 2002 1:01 PM
To: 'Struts Users Mailing List'
Subject: RE:  with JavaScript


Jeff,

Thanks for your response! I tried your suggestion, but it seems that 
<%=employee.getId() %> does not get parsed within  tag. When I view the 
html source on the browser, it shows



Other suggestions?

Thanks!
Tuan

-Original Message-
From: [EMAIL PROTECTED] [mailto:Jeff_Mychasiw@;nlgroup.ca]
Sent: Tuesday, October 22, 2002 11:02 AM
To: Struts Users Mailing List
Subject: Re:  with JavaScript




Try:

  
  
  






"Tuan H. Le" <[EMAIL PROTECTED]> on 10/22/2002 12:33:02 PM

Please respond to "Struts Users Mailing List"
   <[EMAIL PROTECTED]>

To:"Struts Users Mailing List (E-mail)"
   <[EMAIL PROTECTED]>
cc:

Subject: with JavaScript


Hi

Can some one please show me a tip on how to pass a dynamic value into a
JavaScript function within  tag? What I need is to pass an
employee ID in the openModal( '/editSalary.do?id=### ).

Here's my code



  function openModal( theURL ){
 window.showModalDialog(theURL,'','dialogWidth:662px;, dialogHeight:180px;
 help:no; scroll:no; status:no; center:yes; resizable:no; unadorned:yes;');
 }



  
  
  




I know how to create a  that generates an HREF with a passing
dynamic parameter value as such



The code above works fine, but I need a way to open a modal dialog window
with a specific size.

Thanks in advance!
Tuan





(See attached file: winmail.dat)
--
To unsubscribe, e-mail:   <
mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <
mailto:struts-user-help@;jakarta.apache.org>





--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>




RE: with JavaScript

2002-10-22 Thread Tuan H. Le
Jeff,

Thanks for your response! I tried your suggestion, but it seems that 
<%=employee.getId() %> does not get parsed within  tag. When I view the 
html source on the browser, it shows



Other suggestions?

Thanks!
Tuan

-Original Message-
From: [EMAIL PROTECTED] [mailto:Jeff_Mychasiw@;nlgroup.ca]
Sent: Tuesday, October 22, 2002 11:02 AM
To: Struts Users Mailing List
Subject: Re:  with JavaScript




Try:

  
  
  






"Tuan H. Le" <[EMAIL PROTECTED]> on 10/22/2002 12:33:02 PM

Please respond to "Struts Users Mailing List"
   <[EMAIL PROTECTED]>

To:"Struts Users Mailing List (E-mail)"
   <[EMAIL PROTECTED]>
cc:

Subject: with JavaScript


Hi

Can some one please show me a tip on how to pass a dynamic value into a
JavaScript function within  tag? What I need is to pass an
employee ID in the openModal( '/editSalary.do?id=### ).

Here's my code



  function openModal( theURL ){
 window.showModalDialog(theURL,'','dialogWidth:662px;, dialogHeight:180px;
 help:no; scroll:no; status:no; center:yes; resizable:no; unadorned:yes;');
 }



  
  
  




I know how to create a  that generates an HREF with a passing
dynamic parameter value as such



The code above works fine, but I need a way to open a modal dialog window
with a specific size.

Thanks in advance!
Tuan





(See attached file: winmail.dat)
--
To unsubscribe, e-mail:   <
mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <
mailto:struts-user-help@;jakarta.apache.org>





--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>




with JavaScript

2002-10-22 Thread Tuan H. Le
Hi

Can some one please show me a tip on how to pass a dynamic value into a JavaScript 
function within  tag? What I need is to pass an employee ID in the 
openModal( '/editSalary.do?id=### ). 

Here's my code



  function openModal( theURL ){
window.showModalDialog(theURL,'','dialogWidth:662px;, dialogHeight:180px; 
help:no; scroll:no; status:no; center:yes; resizable:no; unadorned:yes;');
}



  
  
  




I know how to create a  that generates an HREF with a passing dynamic 
parameter value as such



The code above works fine, but I need a way to open a modal dialog window with a 
specific size.

Thanks in advance!
Tuan






<>--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: How to determine the last row in a collection

2002-10-21 Thread Tuan H. Le
Adam,

Thanks for your quick response!

In my case, I'm not sure your suggestion would work. 

Here's the logic that I'd like to implement within 

if it's the last row
  dispay 
else
  display 

My collection is an ArrayList, and it's pretty straight forward to achieve this logic 
by using array index and ArrayList.size() method. But, I don't know how to accomplish 
the same result within 

Thanks,
Tuan

-Original Message-
From: Adam Sherman [mailto:adam@;teachandtravel.com]
Sent: Monday, October 21, 2002 10:49 AM
To: Struts Users Mailing List
Subject: Re:  How to determine the last row in a
collection


Just to point out the obvious, but I assume you insert the border 
outside the iterate?

Tuan H. Le wrote:
> 
>   type="com.abc.MyCollectionVO" indexId="idx" length="10" offset="0">
>  // need logic to determine whether it's a last record in a collection
>  // if so, display the outline with border at the bottom
>   

Insert border here.

> 

A.

-- 
Adam Sherman
Software Developer
Teach and Travel Inc.
+1.613.241.3103



--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>




RE: return false

2002-10-20 Thread Tuan H. Le
Hi David,

My bad and you saved my day! Thanks for your help!

Tuan

-Original Message-
From: David M. Karr [mailto:dmkarr@;earthlink.net]
Sent: Sunday, October 20, 2002 1:16 PM
To: [EMAIL PROTECTED]
Subject: Re:  return false


>>>>> "Tuan" == Tuan H Le <[EMAIL PROTECTED]> writes:

Tuan> -Original Message-
Tuan> From: David M. Karr [mailto:dmkarr@;earthlink.net]
Tuan> Sent: Sunday, October 20, 2002 12:45 PM

>>>>> "Tuan" == Tuan H Le <[EMAIL PROTECTED]> writes:

Tuan> session.setAttribute( USER_EMPLOYEE_LIST_KEY, employeeList );
Tuan> // Forward to the appropriate View
Tuan> return ( mapping.findForward( target ) );

Tuan> * My JSP page *
Tuan> <%
Tuan> ArrayList employeeList = (ArrayList)session.getAttribute( 
IConstants.USER_EMPLOYEE_LIST_KEY );

Tuan> 
Tuan> 
Tuan> 
David> What is the value of "IConstants.USER_EMPLOYEE_LIST_KEY"?

Tuan> Hi David,
Tuan> Thanks for your response! 

Tuan> IConstants.USER_EMPLOYEE_LIST_KEY is a string of value "com.xyz.key.USER". 
I'm not sure that's the issue, because the session.getAttribute returned a correct 
ArrayList object employeeList and the for loop works fine.

Read the API documentation for the "present" tag.  You'll find it says this
about the "name" attribute:

  Checks for the existence of a JSP bean, in any scope, with the specified name.

That means the key for the object in the table has to have that name.  In your
"logic:present" tag, you've referenced the name "employeeList", but you put it
into the table with a name of "com.xyz.key.USER".

-- 
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>




RE: return false

2002-10-20 Thread Tuan H. Le
I even replaced the variable IConstants.USER_EMPLOYEE_LIST_KEY to the actual value 
"com.xyz.key.USER" in the session.getAttribute( ... ) method, but still have the same 
issue. Again, the for loop works just fine.

Thanks,
Tuan

-Original Message-----
From: Tuan H. Le 
Sent: Sunday, October 20, 2002 12:50 PM
To: Struts Users Mailing List
Subject: RE:  return false


Hi David,

Thanks for your response! 

IConstants.USER_EMPLOYEE_LIST_KEY is a string of value "com.xyz.key.USER". I'm not 
sure that's the issue, because the session.getAttribute returned a correct ArrayList 
object employeeList and the for loop works fine.

Any ideas?

Thanks,
Tuan

-Original Message-
From: David M. Karr [mailto:dmkarr@;earthlink.net]
Sent: Sunday, October 20, 2002 12:45 PM
To: [EMAIL PROTECTED]
Subject: Re:  return false


>>>>> "Tuan" == Tuan H Le <[EMAIL PROTECTED]> writes:

Tuan> Hi,
Tuan> In my Action class I set an object in one of the session attribute before 
forwarding to a JSP view. But, the  in the JSP view always return false 
on that object.

Tuan>  My Action code ***

Tuan> ...
Tuan> session.setAttribute( USER_EMPLOYEE_LIST_KEY, employeeList );
Tuan> // Forward to the appropriate View
Tuan> return ( mapping.findForward( target ) );

Tuan> * My JSP page *
Tuan> <%
Tuan>   ArrayList employeeList = (ArrayList)session.getAttribute( 
IConstants.USER_EMPLOYEE_LIST_KEY );
Tuan>   // *
Tuan>   // THIS CODE WORK, BUT THE  does not work
Tuan>   // *
Tuan>   //for ( int i = 0; i < employeeList.size(); i++ ) {
Tuan>   //  out.println( "i = " + i + "" );
Tuan>   // EmployeeVO e = (EmployeeVO)employeeList.get( i );
Tuan>   // out.println( "Employee ID --> " + e.getEmployeeId() + "");
Tuan>   //}
Tuan> %>

Tuan> 
Tuan>   
Tuan>   
Tuan>
Tuan>   
Tuan> 

What is the value of "IConstants.USER_EMPLOYEE_LIST_KEY"?

-- 
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>




RE: return false

2002-10-20 Thread Tuan H. Le
Hi David,

Thanks for your response! 

IConstants.USER_EMPLOYEE_LIST_KEY is a string of value "com.xyz.key.USER". I'm not 
sure that's the issue, because the session.getAttribute returned a correct ArrayList 
object employeeList and the for loop works fine.

Any ideas?

Thanks,
Tuan

-Original Message-
From: David M. Karr [mailto:dmkarr@;earthlink.net]
Sent: Sunday, October 20, 2002 12:45 PM
To: [EMAIL PROTECTED]
Subject: Re:  return false


>>>>> "Tuan" == Tuan H Le <[EMAIL PROTECTED]> writes:

Tuan> Hi,
Tuan> In my Action class I set an object in one of the session attribute before 
forwarding to a JSP view. But, the  in the JSP view always return false 
on that object.

Tuan>  My Action code ***

Tuan> ...
Tuan> session.setAttribute( USER_EMPLOYEE_LIST_KEY, employeeList );
Tuan> // Forward to the appropriate View
Tuan> return ( mapping.findForward( target ) );

Tuan> * My JSP page *
Tuan> <%
Tuan>   ArrayList employeeList = (ArrayList)session.getAttribute( 
IConstants.USER_EMPLOYEE_LIST_KEY );
Tuan>   // *
Tuan>   // THIS CODE WORK, BUT THE  does not work
Tuan>   // *
Tuan>   //for ( int i = 0; i < employeeList.size(); i++ ) {
Tuan>   //  out.println( "i = " + i + "" );
Tuan>   // EmployeeVO e = (EmployeeVO)employeeList.get( i );
Tuan>   // out.println( "Employee ID --> " + e.getEmployeeId() + "");
Tuan>   //}
Tuan> %>

Tuan> 
Tuan>   
Tuan>   
Tuan>
Tuan>   
Tuan> 

What is the value of "IConstants.USER_EMPLOYEE_LIST_KEY"?

-- 
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>




return false

2002-10-20 Thread Tuan H. Le
Hi,

In my Action class I set an object in one of the session attribute before forwarding 
to a JSP view. But, the  in the JSP view always return false on that 
object.

Below is my code. Do you know what I'm missing? employeeList is an ArrayList object.

If I use a for loop below (see comment code block), then it finds the employeeList and 
return the right data from that array object.

Thanks,
Tuan

 My Action code ***

...
session.setAttribute( USER_EMPLOYEE_LIST_KEY, employeeList );
// Forward to the appropriate View
return ( mapping.findForward( target ) );


* My JSP page *
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<%@ page import="java.util.ArrayList" %>
<%@ page import="com.phs.ezhr.business.vo.EmployeeVO" %>
<%@ page import="com.phs.ezhr.constant.IConstants" %>

<%
  ArrayList employeeList = (ArrayList)session.getAttribute( 
IConstants.USER_EMPLOYEE_LIST_KEY );

  // *
  // THIS CODE WORK, BUT THE  does not work
  // *
  //for ( int i = 0; i < employeeList.size(); i++ ) {
  //  out.println( "i = " + i + "" );
  // EmployeeVO e = (EmployeeVO)employeeList.get( i );
  // out.println( "Employee ID --> " + e.getEmployeeId() + "");
  //}
%>





  
  






 




  
  
   
  














<>--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: PLEASE HELP - struts-tiles no longer work

2002-10-20 Thread Tuan H. Le
Micael,

Thanks for your help! I corrected my mistake by using the String equals() method, and 
it works fine.

Tuan

-Original Message-
From: micael [mailto:caraunltd@;harbornet.com]
Sent: Saturday, October 19, 2002 12:21 AM
To: Struts Users Mailing List
Subject: Re: PLEASE HELP - struts-tiles no longer work 


I don't know, but my guess is that you meant to use 
someString.equals(someOtherString) rather than someString == 
someOtherString, unless you somehow are using a hidden myString.intern() in 
there.  My guess, in other words, is that you are getting nothing because 
all your "==" tests yield false.  Try sticking a "!" or two in there and 
see if something miraculously appears.  Debuggers are not very clever at 
finding the real problems, like this one, if this is right.

At 12:03 AM 10/19/2002 -0700, you wrote:
>Why don't you look at the source?  My guess is that if you are looking at 
>a blank page, the page, except for tags, is blank.
>
>At 08:41 PM 10/18/2002 -0700, you wrote:
>>Hi,
>>
>>My app was working fine using struts-tiles with frameset. But since this 
>>afternoon, it does not work any more. It displays a blank page (NOT a 404 
>>error).
>>
>>I have tried with debug code, but couldn't figure out. The action forward 
>>seems to work fine after the user login. I tested and it forwarded to the 
>>right View (JSP) which is the MainMenu.jsp. I have been debugging this 
>>issue for the last 5 hrs, and I ran out of idea where to look for a 
>>solution to this problem.
>>
>>Please help!
>>
>>Thanks,
>>Tuan
>>
>>
>>** MainMenu.jsp ***
>>
>><%@ page import="com.phs.ezhr.constant.IConstants" %>
>>
>><%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
>>
>><%
>> // get the user's selected navigation
>> String selTab = (String)session.getAttribute( 
>> IConstants.USER_SEL_TAB_KEY );
>> String selSubTab = (String)session.getAttribute( 
>> IConstants.USER_SEL_SUBTAB_KEY );
>>%>
>>
>><% if ( selTab == IConstants.MANAGER_SUMMARY_TAB ) { %>
>>   
>><% }
>>
>>
>>** Layout.jsp 
>>
>><%@ page language="java" %>
>><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
>><%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
>><%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
>><%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
>>
>><%@ page import="com.phs.ezhr.constant.IConstants" %>
>><%
>> // get the user's selected navigation
>> String selTab = (String)session.getAttribute( 
>> IConstants.USER_SEL_TAB_KEY );
>> String selSubTab = (String)session.getAttribute( 
>> IConstants.USER_SEL_SUBTAB_KEY );
>> // set the frameset row heights for each tab header
>> String rh1 = null;
>> String rh2 = "*";
>> String rh3 = null;
>> String cw1 = null;
>> String cw2 = "*";
>> if ( selTab == IConstants.MANAGER_SUMMARY_TAB ) {
>>   rh1 = "99";
>>   rh3 = "55";
>>   cw1 = "95%";
>> } else if ( selTab == IConstants.SALARY_TAB ) {
>>   rh1 = "201";
>>   rh3 = "125";
>>   cw1 = "97%";
>> } else if ( selTab == IConstants.BONUS_TAB ) {
>>   rh1 = "229";
>>   rh3 = "125";
>>   cw1 = "95%";
>> }
>>%>
>>
>>
>><%=request.getContextPath()%>
>><%=request.getContextPath()%>
>><%=request.getContextPath()%>
>><%=request.getContextPath()%>
>>Select Tab = <%= selTab %>
>>
>>
>>
>>
>>' name="header" id="top" frameborder="0" scrolling="no" noresize 
>>marginwidth="0" marginheight="0" framespacing="0"> ' name="body" 
>>marginwidth="0" marginheight="0" scrolling="yes" frameborder="0" noresize 
>>framespacing="0"> ' name="rightSide" marginwidth="10" marginheight="10" 
>>scrolling="no" frameborder="0" noresize framespacing="0"> ' name="footer" 
>>id="bottom" frameborder="0" scrolling="no" marginwidth="0" 
>>marginheight="0" noresize framespacing="0"> *** 
>>tiles-definitions.xml * >version="1.0" encoding="ISO-8859-1" ?> -- To unsubscribe, e-mail: For 
>>additional commands, e-mail:
>
>Micael
>
>---
>
>This electronic mail  transmission and any accompanying documents contain 
>information belonging to the sender which may be confidential and legally 
>privileged.  This information is intended only for the use of the 
>individual or entity to whom this electronic mail transmission was sent as 
>indicated above. If you are not the intended recipient, any disclosure, 
>copying, distribution, or action taken in reliance on the contents of the 
>information contained in this transmission is strictly prohibited.  If you 
>have received this transmission in error, please delete the 
>message.  Thank you
>
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 
>

Micael


PLEASE HELP - struts-tiles no longer work

2002-10-19 Thread Tuan H. Le
Hi,

My app was working fine using struts-tiles with frameset. But since this afternoon, it 
does not work any more. It displays a blank page (NOT a 404 error).

I have tried with debug code, but couldn't figure out. The action forward seems to 
work fine after the user login. I tested and it forwarded to the right View (JSP) 
which is the MainMenu.jsp. I have been debugging this issue for the last 5 hrs, and I 
ran out of idea where to look for a solution to this problem.

Please help!

Thanks,
Tuan


** MainMenu.jsp ***

<%@ page import="com.phs.ezhr.constant.IConstants" %>

<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>

<%
// get the user's selected navigation
String selTab = (String)session.getAttribute( IConstants.USER_SEL_TAB_KEY );
String selSubTab = (String)session.getAttribute( IConstants.USER_SEL_SUBTAB_KEY );
%>

<% if ( selTab == IConstants.MANAGER_SUMMARY_TAB ) { %>
  
<% }


** Layout.jsp 

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<%@ page import="com.phs.ezhr.constant.IConstants" %>
<%
// get the user's selected navigation
String selTab = (String)session.getAttribute( IConstants.USER_SEL_TAB_KEY );
String selSubTab = (String)session.getAttribute( IConstants.USER_SEL_SUBTAB_KEY );
// set the frameset row heights for each tab header
String rh1 = null;
String rh2 = "*";
String rh3 = null;
String cw1 = null;
String cw2 = "*";
if ( selTab == IConstants.MANAGER_SUMMARY_TAB ) {
  rh1 = "99";
  rh3 = "55";
  cw1 = "95%";
} else if ( selTab == IConstants.SALARY_TAB ) {
  rh1 = "201";
  rh3 = "125";
  cw1 = "97%";
} else if ( selTab == IConstants.BONUS_TAB ) {
  rh1 = "229";
  rh3 = "125";
  cw1 = "95%";
}
%>


<%=request.getContextPath()%>
<%=request.getContextPath()%>
<%=request.getContextPath()%>
<%=request.getContextPath()%>
Select Tab = <%= selTab %>
























*** tiles-definitions.xml *




 http://jakarta.apache.org/struts/dtds/tiles-config.dtd";>



  
  
  
  





  






<>--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: PLEASE HELP - struts-tiles no longer work

2002-10-18 Thread Tuan H. Le


The debug code below returned the correct paths to JSP pages for header, body, 
rightside and footer, but none of them get displayed. It returns a blank page.

<%=request.getContextPath()%>
<%=request.getContextPath()%>
<%=request.getContextPath()%>
   <%=request.getContextPath()%>

   Thanks!
   Tuan

>  -Original Message-----
> From: Tuan H. Le  
> Sent: Friday, October 18, 2002 8:41 PM
> To:   Struts Users Mailing List (E-mail)
> Subject:  PLEASE HELP - struts-tiles no longer work 
> 
> Hi,
> 
> My app was working fine using struts-tiles with frameset. But since this afternoon, 
>it does not work any more. It displays a blank page (NOT a 404 error).
> 
> I have tried with debug code, but couldn't figure out. The action forward seems to 
>work fine after the user login. I tested and it forwarded to the right View (JSP) 
>which is the MainMenu.jsp. I have been debugging this issue for the last 5 hrs, and I 
>ran out of idea where to look for a solution to this problem.
> 
> Please help!
> 
> Thanks,
> Tuan
> 
> 
> ** MainMenu.jsp ***
> 
> <%@ page import="com.phs.ezhr.constant.IConstants" %>
> 
> <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
> 
> <%
> // get the user's selected navigation
> String selTab = (String)session.getAttribute( IConstants.USER_SEL_TAB_KEY );
> String selSubTab = (String)session.getAttribute( IConstants.USER_SEL_SUBTAB_KEY 
>);
> %>
> 
> <% if ( selTab == IConstants.MANAGER_SUMMARY_TAB ) { %>
>   
> <% }
> 
> 
> ** Layout.jsp 
> 
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
> 
> <%@ page import="com.phs.ezhr.constant.IConstants" %>
> <%
> // get the user's selected navigation
> String selTab = (String)session.getAttribute( IConstants.USER_SEL_TAB_KEY );
> String selSubTab = (String)session.getAttribute( IConstants.USER_SEL_SUBTAB_KEY 
>);
> // set the frameset row heights for each tab header
> String rh1 = null;
> String rh2 = "*";
> String rh3 = null;
> String cw1 = null;
> String cw2 = "*";
> if ( selTab == IConstants.MANAGER_SUMMARY_TAB ) {
>   rh1 = "99";
>   rh3 = "55";
>   cw1 = "95%";
> } else if ( selTab == IConstants.SALARY_TAB ) {
>   rh1 = "201";
>   rh3 = "125";
>   cw1 = "97%";
> } else if ( selTab == IConstants.BONUS_TAB ) {
>   rh1 = "229";
>   rh3 = "125";
>   cw1 = "95%";
> }
> %>
> 
> 
> <%=request.getContextPath()%>
> <%=request.getContextPath()%>
> <%=request.getContextPath()%>
> <%=request.getContextPath()%>
> Select Tab = <%= selTab %>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> framespacing="0">
> name="header" id="top" frameborder="0" scrolling="no" noresize marginwidth="0" 
>marginheight="0" framespacing="0">
> 
> name="body" marginwidth="0" marginheight="0" scrolling="yes" frameborder="0" noresize 
>framespacing="0">> 
> scrolling="no" frameborder="0" noresize framespacing="0">
> 
> name="footer" id="bottom" frameborder="0" scrolling="no" marginwidth="0" 
>marginheight="0" noresize framespacing="0">
> 
> 
> 
> 
> 
> 
> 
> 
> *** tiles-definitions.xml *
> 
> 
> 
> 
>  "-//Apache Software Foundation//DTD Tiles Configuration//EN"
>"http://jakarta.apache.org/struts/dtds/tiles-config.dtd";>
> 
> 
> 
>   
>   
>   
>   
> 
> 
> 
> 
> 
>   
> 
> 
> 
> 
>  << File: ATT117202.txt >> 

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>




to open a modal window (pop-up)

2002-10-18 Thread Tuan H. Le
Hi,
Within my  code I use  for generating a href to an Action as 
below

When the user click on the image, I would like to pop-up another window to display the 
employee details information. How do I accomplish this feature in Struts + ?
I searched through the archived, but couldn't find the info.
Thanks in advance for your help!
Tuan



<>--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: - Is it possible???

2002-10-18 Thread Tuan H. Le
David,

It works! Thanks for your quick help!

Tuan

-Original Message-
From: Karr, David [mailto:david.karr@;attws.com]
Sent: Thursday, October 17, 2002 4:16 PM
To: 'Struts Users Mailing List'
Subject: RE:  - Is it possible???


> -Original Message-
> From: Tuan H. Le [mailto:tuan.le@;phsadc.com]
> Sent: Thursday, October 17, 2002 4:10 PM
> To: [EMAIL PROTECTED]
> Subject:  - Is it possible???

>  type="..." indexId="idx">
>   
> 
> 
> How do I display the employee's salary record, ie: amount, 
> merit percent, ...?

I believe you'd just do this (ignoring layout issues):


  
  


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>




- Is it possible???

2002-10-18 Thread Tuan H. Le
Hi,
I have two classes Salary and Employee

public class Salary {
  private Date date;
  private double amount;
  private float meritPercent;
  ...
  // and Salary class accessor methods (setter/getter) 
}

public class Employee {
  Salary salary;
  private int id;
  private String lastName;
  ...
  // and Employee class accessor methods  
}

In my JSP page, it needs to display a collection (List) of Employee records with 
Salary data. 


  


How do I display the employee's salary record, ie: amount, merit percent, ...?

Thanks in advance for your help!

Tuan



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Using Frameset within Struts - displayed a blank page

2002-10-07 Thread Tuan H. Le

Hi Brian,

Thanks for your response! I tried to define a forward within the /selectTab action, 
but I still see a blank page. The new action mapping is below





Read the Struts archive, it seems that using tiles/template is a better choice than 
calling in action in the frame src attribute.

Also, it would be much appreciated if some one can share a sample code and 
configuration on how to develop tabs functionality with frame and tiles. I'm going 
through tiles-documentation tutorial. 

The layout that we have for our application is below

Top frame: Tab labels
Middle frame: content body
Bottom frame: other data and footer.

Thanks!
Tuan

-Original Message-
From: Brian DeLuca [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 1:28 PM
To: [EMAIL PROTECTED]
Subject: RE: Using Frameset within Struts - displayed a blank page




Interesting.  Never tried calling in action in a SRC attribute.  Seems like it works 
since you are getting a blank page, and not a HTTP: 404 error ( Page not found ).

When I see blank white pages it is usually a problem with your forwards.  I don't see 
a forward defined in the selectTab action definition in the Struts-config file.
Is it a Global forward? is it misspelled in your code?  

Keeping in mind that the input attribute doesn't get checked for forwards, that is 
used for validation.

hth
b-

 --- On Mon 10/07, Tuan H. Le  wrote:
From: Tuan H. Le [mailto: [EMAIL PROTECTED]]
To: [EMAIL PROTECTED]
Date: Mon, 7 Oct 2002 12:08:44 -0700
Subject: Using Frameset within Struts - displayed a blank page

> I have searched through the struts archive, but couldn't find a solution to
> my problem below. 
> 
> if I specified , it found and
> displayed the Top.jsp fine.
>  id="top" frameborder="0" scrolling="no"
> noresize marginwidth="0" marginheight="0"
> framespacing="0">
> However, after I changed to ,
> then it displayed a blank page in the top frame.
> 
> Do you know what I'm missing?
> 
> Thanks in advance
> Tuan
> 
> Here are my settings and code.
> 
>  struts-config.xml (a partial file) --
>   
>  type="com.phs.ezhr.presentation.form.LoginForm" />
>  type="com.phs.ezhr.presentation.form.MainMenuForm" />
>   
>   
> 
> type="com.phs.ezhr.presentation.action.MainMenuAction"
> validate="false"
> input="/Top.jsp"
> name="mainMenuForm"
> scope="request" >
> 
> 
> 
>  MainMenu.jsp -
> 
> 
>  prefix="html" %>
>  prefix="bean" %>
> 
> 
> 
> 
> 
>  />
> 
> 
>  framespacing="0">
>  id="top" frameborder="0" scrolling="no"
> noresize marginwidth="0" marginheight="0"
> framespacing="0">
> 
>  marginwidth="0" marginheight="0"
> scrolling="yes" frameborder="0" noresize
> framespacing="0">
>  marginwidth="10" marginheight="10"
> scrolling="no" frameborder="0" noresize
> framespacing="0">
> 
>  id="btm" frameborder="0" scrolling="no"
> marginwidth="0" marginheight="0" noresize
> framespacing="0">
> 
> 
> 
> 
> 
> 
>  Top.jsp -
> 
> 
>  prefix="html" %>
>  prefix="bean" %>
>  prefix="logic" %>
> 
> 
> 
>  Transitional//EN">
> 
>  href="stylesheets/styleTop.css">
> 
> 
>/>
> 
> 
>  // get the passed in request parameter
> String value = request.getParameter( IConstants.USER_SEL_TAB_KEY );
> // set the request attribute to be used within the  JSP
> tag
> request.setAttribute( IConstants.USER_SEL_TAB_KEY, value );
> %>
> 
>name="mainMenuForm"
>   type="com.phs.ezhr.presentation.form.MainMenuForm"
>   method="POST">
>  cellspacing="0" cellpadding="0">
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> > --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 


Changed your e-mail?  Keep your contacts!  Use this free e-mail change of address 
service from Return Path.  Register now!

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


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




Using Frameset within Struts - displayed a blank page

2002-10-07 Thread Tuan H. Le

I have searched through the struts archive, but couldn't find a solution to my problem 
below. 

if I specified , it found and displayed the Top.jsp fine.

However, after I changed to , then it displayed a blank 
page in the top frame.

Do you know what I'm missing?

Thanks in advance
Tuan

Here are my settings and code.

 struts-config.xml (a partial file) --
  


  
  




 MainMenu.jsp -

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>





















 Top.jsp -

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<%@ page import="com.phs.ezhr.constant.IConstants" %>









<%
// get the passed in request parameter
String value = request.getParameter( IConstants.USER_SEL_TAB_KEY );
// set the request attribute to be used within the  JSP tag
request.setAttribute( IConstants.USER_SEL_TAB_KEY, value );
%>















<>
--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: Passing a request parameter within Struts framework

2002-10-07 Thread Tuan H. Le

Hi Luca,

Great suggestion! Also, I agree with you about not using frame, but we have a business 
requirement that requires us to use a frame, ie: the user does not want to see the 
table headings (and some other data) disappear in a page when they scroll down the 
list of records.

Thanks,
Tuan

-Original Message-
From: Luca Zago [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 6:55 AM
To: Struts Users Mailing List
Subject: Re: Passing a request parameter within Struts framework


Hi,
your problem is clear, and it has very few solutions :)
The problem is that you use frames. Every Frame in a different request,
then the request from your form..end at the page containing the 
frameset, and your request with your parameters set in your form ends 
here. All the pages inside the frames are different GET requests from 
the browser, then they cannot have access your parameters and 
attributess (belonging to you former request).
Solutions:
if your parameter is only a string you can build a string chain..in the 
src of your frame tag:
" 
name="top" id="top" frameborder="0" scrolling="no" noresize 
marginwidth="0" marginheight="0" framespacing="0">
In this case your new request wll have the parameter named myparameterName.
It's very unelegant solution but it could work
Second put your object in the user's session. it's resonable to put it 
in session after all, if I understand well, is an attribute of a user's 
profile.

A general suggestions, don't user frames in dynamic pages, you can have 
always problems with them, Jsp has a nice templating machanism, use that 
to build your header or footer.


Tuan H. Le wrote:
> Hi,
> 
> How do I pass a request attribute to another form? In my case, after a successful 
>login, it would forward the user to 
> the main form (MainMeu.jsp which has a frameset). In the main form, it has several 
>tabs. By default, it displays the
> first tab.
> 
> Currently, in the perform() method of LoginAction class, I have the following code
> 
> //...
> request.setAttribute( "selTopNav", "1" );
> return( mapping.findForward( target ) );
> 
> 
> Here's the code for the MainMenu.jsp
> 
> 
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> 
> 
> 
> 
> 
> 
> 
> marginwidth="0" marginheight="0" framespacing="0">
> 
> scrolling="yes" frameborder="0" noresize framespacing="0">
> marginheight="10" scrolling="no" frameborder="0" noresize framespacing="0">
> 
> marginwidth="0" marginheight="0" noresize framespacing="0">
> 
> 
> 
> 
> 
> 
> 
> And, in the Top.jsp, I have a test code to get a value of the request attribute, but 
>it always returns a null value
> 
> Top Nav: <%= request.getParameter( "selTopNav" ) %>
> 
> Here's a partial of my struts-config.xml file
> 
>   
> 
> type="com.phs.ezhr.presentation.form.MainMenuForm" />
>   
> 
>   
> 
>   
> 
>   
>   
> 
>  type="com.phs.ezhr.presentation.action.LoginAction"
> validate="true"
> input="/Login.jsp"
> name="loginForm"
> scope="session" >
>   path="/MainMenu.jsp" />
>   path="/Login.jsp" />
> 
> 
>  type="com.phs.ezhr.presentation.action.LogoffAction">
> 
> 
>  type="com.phs.ezhr.presentation.action.MainMenuAction"
> validate="false"
> input="/Top.jsp"
> name="mainMenuForm"
> scope="request" >
> 
>   
> 
> 
> Do you know what I'm missing?
> 
> Thanks,
> Tuan
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

-- 
Luca Zago
Senior IT Developer
_

E-TREE S.p.a.  Via Fonderia 43 - 31100 Treviso (Italy)
phone +39.0422.3107
fax   +39.0422.310888
http://www.e-tree.com  http://www.webanana.com
_


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


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




RE: Passing a request parameter within Struts framework

2002-10-07 Thread Tuan H. Le

Hi,

I tried request.getAttribute( "selTopNav" ) too, but it still returned a null value.

Thanks,
Tuan

-Original Message-
From: Thomas Eichberger [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 6:28 AM
To: Struts Users Mailing List
Cc: Struts Users Mailing List (E-mail)
Subject: Re: Passing a request parameter within Struts framework


request.getAttribute( "selTopNav" )

not request.getParameter( "selTopNav" )

!!!


At 05:00 07.10.2002 -0700, Tuan H. Le wrote:
>Hi,
>
>How do I pass a request attribute to another form? In my case, after a 
>successful login, it would forward the user to
>the main form (MainMeu.jsp which has a frameset). In the main form, it has 
>several tabs. By default, it displays the
>first tab.
>
>Currently, in the perform() method of LoginAction class, I have the 
>following code
>
>//...
>request.setAttribute( "selTopNav", "1" );
>return( mapping.findForward( target ) );
>
>
>Here's the code for the MainMenu.jsp
>
>
><%@ page language="java" %>
><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
><%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
>
>
>
>
>And, in the Top.jsp, I have a test code to get a value of the request 
>attribute, but it always returns a null value
>
>Top Nav: <%= request.getParameter( "selTopNav" ) %>
>
>Here's a partial of my struts-config.xml file
>
>   
>  type="com.phs.ezhr.presentation.form.LoginForm" />
>  type="com.phs.ezhr.presentation.form.MainMenuForm" />
>   
>
>   
> 
>   
>
>   
>   
> 
>  type="com.phs.ezhr.presentation.action.LoginAction"
> validate="true"
> input="/Login.jsp"
> name="loginForm"
> scope="session" >
>   path="/MainMenu.jsp" />
>   path="/Login.jsp" />
> 
> 
>  type="com.phs.ezhr.presentation.action.LogoffAction">
> 
> 
>  type="com.phs.ezhr.presentation.action.MainMenuAction"
> validate="false"
> input="/Top.jsp"
> name="mainMenuForm"
> scope="request" >
> 
>   
>
>
>Do you know what I'm missing?
>
>Thanks,
>Tuan
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


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


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




RE: Passing a request parameter within Struts framework

2002-10-07 Thread Tuan H. Le

Hi,

I added Andrew's code tip as below, but it still returns a null value for the request 
parameter.

public final class LoginAction extends Action {
  public ActionForward perform(  ) {
// . . .
ActionForward curForward = mapping.findForward( target );
String path = URLUtil.addParameterToURL( curForward.getPath(), "selTopNav", "1" );
System.out.println( path );
ActionForward newForward = new ActionForward( path, curForward.getRedirect() );
return newForward;
  }
}

public class URLUtil {
  public static String addParameterToURL( String anURL,
  String aParameter,
  String aValue ) {
if ( anURL == null ) {
  return aParameter + "=" + aValue;
} else {
  return anURL + ( (anURL.indexOf( "?" ) == -1) ? "?" : "&" ) + aParameter + "=" + 
aValue;
}
  }
}

-- MainMenu.jsp (where it get forwarded to for a successful login -
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>



















 Top.jsp (a frame within a frameset and where the request.getParameter get called) 
--

Selected Top Nav: <%= request.getParameter( "selTopNav" ) %>


This returns a null value instead of "1".

I must have missed some thing here.

Thanks,
Tuan



-Original Message-
From: Tuan H. Le 
Sent: Monday, October 07, 2002 6:02 AM
To: Struts Users Mailing List
Subject: RE: Passing a request parameter within Struts framework


Andrew,

Thanks again for your help! I'm going to try your suggestion soon.

Tuan

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 5:41 AM
To: Struts Users Mailing List
Subject: RE: Passing a request parameter within Struts framework


Had another look at your question and realised it is attributes rather than
parameters (Im always getting these mixed up!) that you stated in your
original question! (hehe guess my response was too quick!).
Given that this is the case, it should be useable in the next page unless
the forward is a redirecting forward.
Dont use jsp much so cant remember the 'best' way to expose it to the page,
but you could probably use a runtime expression thinghy (<%=
request.getAttribute("selTopNav"); %>

If however you need it as a request parameter the way I always do it is as
mentioned below and heres some code to illustrate:

firstly a simple method for adding parameters onto urls:
(btw: you can probably lose the first half of that "if" - Im just paranoid
about nulls ;->)

public static String addParameterToURL(String url, String parameter, String
value)
{
  if(url == null)
  {
return parameter + "=" + value;
  }
  else
  {
return url + ( (url.indexOf("?")==-1) ? "?" : "&" ) + parameter + "=" +
value;
  }
}

and to use this with forwards:

ActionForward fwd = mapping.findForward( target );
String path = addParameterToURL(forward.getPath(),"selTopNav","1");
ActionForward newFwd = new ActionForward(path,fwd.getRedirect() );
return newFwd;

-Original Message-
From: Tuan H. Le [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 20:19
To: Struts Users Mailing List
Subject: RE: Passing a request parameter within Struts framework


Andrew,

Thanks for a quick response! Do you have a sample code that I can use? It
seems to me that are several lines of code to complete your suggestion. Is
this the only way to pass a request parameter within the LoginAction to
another JSP page? Eventually, I need to pass the request parameter selTopNav
(the user's selected tab) value back and forth to determine which tab the
user has selected.

Thanks again!
Tuan

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 5:07 AM
To: Struts Users Mailing List
Subject: RE: Passing a request parameter within Struts framework


In your action you can create a new forward object and return that.
ie: get the forward for target, extract its url and append required
parameter(s) and create a new forward using that and the redirect value from
the one you looked up, and return the new one.

>  -Original Message-
> From: Tuan H. Le [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 07, 2002 20:01
> To:   Struts Users Mailing List (E-mail)
> Subject:  Passing a request parameter within Struts framework
>
> Hi,
>
> How do I pass a request attribute to another form? In my case, after a
successful login, it would forward the user to
> the main form (MainMeu.jsp which has a frameset). In the mai

RE: Passing a request parameter within Struts framework

2002-10-07 Thread Tuan H. Le

Andrew,

Thanks again for your help! I'm going to try your suggestion soon.

Tuan

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 5:41 AM
To: Struts Users Mailing List
Subject: RE: Passing a request parameter within Struts framework


Had another look at your question and realised it is attributes rather than
parameters (Im always getting these mixed up!) that you stated in your
original question! (hehe guess my response was too quick!).
Given that this is the case, it should be useable in the next page unless
the forward is a redirecting forward.
Dont use jsp much so cant remember the 'best' way to expose it to the page,
but you could probably use a runtime expression thinghy (<%=
request.getAttribute("selTopNav"); %>

If however you need it as a request parameter the way I always do it is as
mentioned below and heres some code to illustrate:

firstly a simple method for adding parameters onto urls:
(btw: you can probably lose the first half of that "if" - Im just paranoid
about nulls ;->)

public static String addParameterToURL(String url, String parameter, String
value)
{
  if(url == null)
  {
return parameter + "=" + value;
  }
  else
  {
return url + ( (url.indexOf("?")==-1) ? "?" : "&" ) + parameter + "=" +
value;
  }
}

and to use this with forwards:

ActionForward fwd = mapping.findForward( target );
String path = addParameterToURL(forward.getPath(),"selTopNav","1");
ActionForward newFwd = new ActionForward(path,fwd.getRedirect() );
return newFwd;

-Original Message-
From: Tuan H. Le [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 20:19
To: Struts Users Mailing List
Subject: RE: Passing a request parameter within Struts framework


Andrew,

Thanks for a quick response! Do you have a sample code that I can use? It
seems to me that are several lines of code to complete your suggestion. Is
this the only way to pass a request parameter within the LoginAction to
another JSP page? Eventually, I need to pass the request parameter selTopNav
(the user's selected tab) value back and forth to determine which tab the
user has selected.

Thanks again!
Tuan

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 5:07 AM
To: Struts Users Mailing List
Subject: RE: Passing a request parameter within Struts framework


In your action you can create a new forward object and return that.
ie: get the forward for target, extract its url and append required
parameter(s) and create a new forward using that and the redirect value from
the one you looked up, and return the new one.

>  -Original Message-
> From: Tuan H. Le [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 07, 2002 20:01
> To:   Struts Users Mailing List (E-mail)
> Subject:  Passing a request parameter within Struts framework
>
> Hi,
>
> How do I pass a request attribute to another form? In my case, after a
successful login, it would forward the user to
> the main form (MainMeu.jsp which has a frameset). In the main form, it has
several tabs. By default, it displays the
> first tab.
>
> Currently, in the perform() method of LoginAction class, I have the
following code
>
> //...
> request.setAttribute( "selTopNav", "1" );
> return( mapping.findForward( target ) );
>
>
> Here's the code for the MainMenu.jsp
>
>
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
>
> And, in the Top.jsp, I have a test code to get a value of the request
attribute, but it always returns a null value
>
> Top Nav: <%= request.getParameter( "selTopNav" ) %>
>
> Here's a partial of my struts-config.xml file
>
>   
> 
> 
>   
>
>   
> 
>   
>
>   
>   
> 
>  type="com.phs.ezhr.presentation.action.LoginAction"
> validate="true"
> input="/Login.jsp"
> name="loginForm"
> scope="session" >
>   path="/MainMenu.jsp" />
>   path="/Login.jsp" />
> 
> 
>  type="com.phs.ezhr.presentation.action.LogoffAction">
> 
> 
>  type="com.phs.ezhr.presentation.action.MainMenuAction"
> validate="fal

RE: Passing a request parameter within Struts framework

2002-10-07 Thread Tuan H. Le

Andrew,

Thanks for a quick response! Do you have a sample code that I can use? It seems to me 
that are several lines of code to complete your suggestion. Is this the only way to 
pass a request parameter within the LoginAction to another JSP page? Eventually, I 
need to pass the request parameter selTopNav (the user's selected tab) value back and 
forth to determine which tab the user has selected.

Thanks again!
Tuan

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 5:07 AM
To: Struts Users Mailing List
Subject: RE: Passing a request parameter within Struts framework


In your action you can create a new forward object and return that.
ie: get the forward for target, extract its url and append required
parameter(s) and create a new forward using that and the redirect value from
the one you looked up, and return the new one.

>  -Original Message-
> From:         Tuan H. Le [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 07, 2002 20:01
> To:   Struts Users Mailing List (E-mail)
> Subject:  Passing a request parameter within Struts framework
>
> Hi,
>
> How do I pass a request attribute to another form? In my case, after a
successful login, it would forward the user to
> the main form (MainMeu.jsp which has a frameset). In the main form, it has
several tabs. By default, it displays the
> first tab.
>
> Currently, in the perform() method of LoginAction class, I have the
following code
>
> //...
> request.setAttribute( "selTopNav", "1" );
> return( mapping.findForward( target ) );
>
>
> Here's the code for the MainMenu.jsp
>
>
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
>
> And, in the Top.jsp, I have a test code to get a value of the request
attribute, but it always returns a null value
>
> Top Nav: <%= request.getParameter( "selTopNav" ) %>
>
> Here's a partial of my struts-config.xml file
>
>   
> 
> 
>   
>
>   
> 
>   
>
>   
>   
> 
>  type="com.phs.ezhr.presentation.action.LoginAction"
> validate="true"
> input="/Login.jsp"
> name="loginForm"
> scope="session" >
>   path="/MainMenu.jsp" />
>   path="/Login.jsp" />
> 
> 
>  type="com.phs.ezhr.presentation.action.LogoffAction">
> 
> 
>  type="com.phs.ezhr.presentation.action.MainMenuAction"
> validate="false"
> input="/Top.jsp"
> name="mainMenuForm"
> scope="request" >
> 
>   
>
>
> Do you know what I'm missing?
>
> Thanks,
> Tuan
>
>  << File: ATT00078.txt >>


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


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




Passing a request parameter within Struts framework

2002-10-07 Thread Tuan H. Le

Hi,

How do I pass a request attribute to another form? In my case, after a successful 
login, it would forward the user to 
the main form (MainMeu.jsp which has a frameset). In the main form, it has several 
tabs. By default, it displays the
first tab.

Currently, in the perform() method of LoginAction class, I have the following code

//...
request.setAttribute( "selTopNav", "1" );
return( mapping.findForward( target ) );


Here's the code for the MainMenu.jsp


<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>




















And, in the Top.jsp, I have a test code to get a value of the request attribute, but 
it always returns a null value

Top Nav: <%= request.getParameter( "selTopNav" ) %>

Here's a partial of my struts-config.xml file

  


  

  

  

  
  











  


Do you know what I'm missing?

Thanks,
Tuan



<>
--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: About Datasource

2002-09-30 Thread Tuan H. Le

Hi,

I'm experiencing this same problem. If you have a solution, please post.

Thanks,
Tuan 

-Original Message-
From: Kalaiselvan [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 30, 2002 2:18 AM
To: Struts Users Mailing List
Subject: About Datasource


Hii All,

Any one know how to get multiple Datasource from Struts.
Because i think in Struts-config.xml, we are able to specify only one
Datasource.

Also I got an error when I configure my datasources in tomcat's
sever.xml  I couldnt able to get that datasource name in
my Strtus's application.But my ordinary application can able to ge the
Datasources from server.xml. Why this is happend???

Thanx in Advance

Kalaiselvna.S


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Cannot load JDBC driver class 'null'

2002-09-27 Thread Tuan H. Le

Hi,

I'm having a problem of configuring Tomcat 4.1 with Opta2000 JDBC driver for SQL 
Server 2000. I can load the same JDBC driver through the code, but it could not load 
that same driver during Tomcat startup process. I followed the instructions and 
examples on the internet sites. 

Do you know what I am missing?
Thanks!
Tuan

My Tomcat setting is below:

1) Put Opta2000.jar in the \WEB-INF\lib directory
2) Defined Datasource context in the server.xml

  
  
  
  

   maxActive
   100


   maxIdle
   1000


  maxWait
  100


   user
   x


   password
   y


   driverClassName
   com.inet.tds.TdsDriver


   driverName
   jdbc:inetdae7:localhost:1433:Database=ezhr

  

3) Defined resource-ref in the \WEB-INF\web.xml file
  

  Resource reference to a factory for java.sql.Connection instances that may be 
used for talking to a particular database that is configured in the server.xml file

jdbc/ezhr
javax.sql.DataSource
Container
  



Here's the error in Tomcat log file:

java.sql.SQLException: Cannot load JDBC driver class 'null'
at 
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:529)
at 
org.apache.commons.dbcp.BasicDataSource.setLogWriter(BasicDataSource.java:381)
at 
org.apache.struts.action.ActionServlet.initApplicationDataSources(ActionServlet.java:942)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:457)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:924)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:813)
at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3342)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3534)
at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:821)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579)
at 
org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:257)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:772)
at 
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:569)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:411)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:879)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:368)
at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1196)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
at org.apache.catalina.core.StandardService.start(StandardService.java:497)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2191)
at org.apache.catalina.startup.Catalina.start(Catalina.java:510)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
[ERROR] ActionServlet - -Initializing application data source 
org.apache.struts.action.DATA_SOURCE 

2002-09-27 16:20:17 StandardContext[/ezhr]: Servlet /ezhr threw load() exception
javax.servlet.UnavailableException: Initializing application data source 
org.apache.struts.action.DATA_SOURCE
at 
org.apache.struts.action.ActionServlet.initApplicationDataSources(ActionServlet.java:946)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:457)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:924)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:813)
at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3342)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3534)
at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:821)
at org.apache.catalina.co

"tiles-definitions" is incomplete

2002-09-27 Thread Tuan H. Le

Hi,

I just found this error in tomcat log, and I couldn't figure out the reason for 
causing this error when I don't use struts-tiles tag. Though, I didn't see this error 
before. I must have modified the web.xml file. Here is the error message with the 
web.xml file

Please advise on troubleshooting this error.

Thanks in advance for your help!
Tuan

org.xml.sax.SAXParseException: The content of element type "tiles-definitions" is 
incomplete, it must match "(definition)+".
at 
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:232)
at 
org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:173)
at 
org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:362)
at 
org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:296)
at 
org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:1953)
at 
org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:878)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.handleEndElement(XMLDocumentFragmentScannerImpl.java:1144)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:987)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1445)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:333)
at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:524)
at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:580)
at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
at 
org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1169)
at org.apache.commons.digester.Digester.parse(Digester.java:1514)
at org.apache.struts.tiles.xmlDefinition.XmlParser.parse(XmlParser.java:341)
at 
org.apache.struts.tiles.xmlDefinition.I18nFactorySet.parseXmlFile(I18nFactorySet.java:529)
at 
org.apache.struts.tiles.xmlDefinition.I18nFactorySet.parseXmlFiles(I18nFactorySet.java:466)
at 
org.apache.struts.tiles.xmlDefinition.I18nFactorySet.createDefaultFactory(I18nFactorySet.java:294)
at 
org.apache.struts.tiles.xmlDefinition.I18nFactorySet.initFactory(I18nFactorySet.java:267)
at 
org.apache.struts.tiles.xmlDefinition.I18nFactorySet.initFactory(I18nFactorySet.java:215)
at 
org.apache.struts.tiles.definition.ComponentDefinitionsFactoryWrapper.init(ComponentDefinitionsFactoryWrapper.java:69)
at 
org.apache.struts.tiles.DefinitionsUtil.createDefinitionsFactory(DefinitionsUtil.java:276)
at org.apache.struts.tiles.TilesPlugin.init(TilesPlugin.java:147)
at 
org.apache.struts.action.ActionServlet.initApplicationPlugIns(ActionServlet.java:991)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:458)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:924)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:813)
at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3342)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3534)
at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:821)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579)
at 
org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:257)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:772)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:502)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:410)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:879)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:368)
at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1196)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
at org.apache.catalina.core.StandardService.start(StandardService.java:497)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2191)
at org.apache.catalina.startup.Catalina.start(Catalina.java:510)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at

RE: Newbie Question: Login form submit error - Servlet action is currently unavailable

2002-09-23 Thread Tuan H. Le

Eddie, Mark,

Thanks for your tips!!! I found a data source error in the Tomcat localhost_log.. 
After removing the data source element in the struts-conf.xml file, the login works as 
expected.

Thanks again!
Tuan

-Original Message-
From: Galbreath, Mark [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 23, 2002 2:10 PM
To: 'Struts Users Mailing List'
Subject: RE: Newbie Question: Login form submit error - Servlet action
is currently unavailable


go to www.wrox.com and get chapter 23 of jsp pro

Just kidding.  A 503 error usually means the ProcessPreprocess class is
failing; what does your server log read?

Mark

-Original Message-----
From: Tuan H. Le [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 23, 2002 3:57 PM
To: [EMAIL PROTECTED]
Subject: Newbie Question: Login form submit error - Servlet action is
currently unavailable


Hi,

I'm trying to get the login functionality to work with Struts, but when I
submit data from a login form (with empty user ID/password or witth data), I
got an error

HTTP Status 503 - Servlet action is currently unavailable

Here're my struts-config.xml, login.jsp, LoginForm.java
1) struts-config.xml

http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd";>

  
  
  

  

  

  


  

  
  



  

  

  



2) login.jsp
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>




  
  

  

  

  

 
  


  


  




  

  

  


  :
  


  :
  

 

  

  

  


  


3) LoginForm.java
package com.phs.ezhr.forms;

/**
 * Title:
 * Description: It provides accessors to data members that map to the values
 * submitted by the Login View -- employee ID and password -- and it
performs
 * some simple validation of those values.  If the values pass the
validation,
 * then the transaction continues; otherwise, ActionErrors are created and
the
 * request is forwarded back to the value defined by this Actions input
 * sub-element, which in this case is Login.jsp
 * Copyright:Copyright (c) 2002
 * Company:  PacifiCare Health Systems - ADC
 * @author Tuan H. Le
 * @version 1.0
 */

import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionMapping;

/**
 * This ActionForm is used by the EZHR appliation to validate
 * that the user has entered an employee ID and a password. If one or
 * both of the fields are empty when validate is called by the
 * ActionServlet, error messages are created.
 */
public class LoginForm extends ActionForm {
  // The user's password
  private String password;

  // The user's access ID
  private String employeeId;
  /**
   * Default Constructor
   */
  public LoginForm() {
super();
resetFields();
  }

  /**
   * This method is called with every request.  It resets the
   * Form attribute prior to setting the values in the new
   * request.
   *
   * @param mapping The mapping used to select this instance
   * @param request The servlet request we are processing
   */
  public void reset( ActionMapping mapping,
 HttpServletRequest request ) {

// Clear out the access number and pin number fields
resetFields();
  }

  /**
   * @param anEmployeeId The employee ID
   */
  public void setEmployeeId( String anEmployeeId ) {
this.employeeId = anEmployeeId;
  }

  /**
  * @retrurn The employee ID
  */
  public String getEmployeeId() {
return this.employeeId;
  }

  public void setPassword( String aPassword ) {
this.password = aPassword;
  }

  /**
  * @retrurn The employee password
  */
  public String getPassword() {
return this.password;
  }

  protected void resetFields() {
this.employeeId = "";
this.password = "";
  }

  /**
   * Validate the properties that have been set from this HTTP request,
   * and return an ActionErrors object that encapsulates any
   * validation errors that have been found.  If no errors are found, return
   * null or an ActionErrors object with no
   * recorded error messages.
   *
   * @param mapping The mapping used to select this instance
   * @param request The servlet request we are processing
   */
  public ActionErrors validate( ActionMapping mapping,
HttpServletRequest request ) {
ActionErrors errors = new ActionErrors();

// Check and see if the access number is missing
if

Newbie Question: Login form submit error - Servlet action is currently unavailable

2002-09-23 Thread Tuan H. Le

Hi,

I'm trying to get the login functionality to work with Struts, but when I submit data 
from a login form (with empty user ID/password or witth data), I got an error

HTTP Status 503 - Servlet action is currently unavailable

Here're my struts-config.xml, login.jsp, LoginForm.java
1) struts-config.xml

http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd";>

  
  
  

  

  

  


  

  
  



  

  

  



2) login.jsp
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>




  
  

  

  

  

 
  


  


  




  

  

  


  :
  


  :
  

 

  

  

  


  


3) LoginForm.java
package com.phs.ezhr.forms;

/**
 * Title:
 * Description: It provides accessors to data members that map to the values
 * submitted by the Login View -- employee ID and password -- and it performs
 * some simple validation of those values.  If the values pass the validation,
 * then the transaction continues; otherwise, ActionErrors are created and the
 * request is forwarded back to the value defined by this Actions input
 * sub-element, which in this case is Login.jsp
 * Copyright:    Copyright (c) 2002
 * Company:  PacifiCare Health Systems - ADC
 * @author Tuan H. Le
 * @version 1.0
 */

import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionMapping;

/**
 * This ActionForm is used by the EZHR appliation to validate
 * that the user has entered an employee ID and a password. If one or
 * both of the fields are empty when validate is called by the
 * ActionServlet, error messages are created.
 */
public class LoginForm extends ActionForm {
  // The user's password
  private String password;

  // The user's access ID
  private String employeeId;
  /**
   * Default Constructor
   */
  public LoginForm() {
super();
resetFields();
  }

  /**
   * This method is called with every request.  It resets the
   * Form attribute prior to setting the values in the new
   * request.
   *
   * @param mapping The mapping used to select this instance
   * @param request The servlet request we are processing
   */
  public void reset( ActionMapping mapping,
 HttpServletRequest request ) {

// Clear out the access number and pin number fields
resetFields();
  }

  /**
   * @param anEmployeeId The employee ID
   */
  public void setEmployeeId( String anEmployeeId ) {
this.employeeId = anEmployeeId;
  }

  /**
  * @retrurn The employee ID
  */
  public String getEmployeeId() {
return this.employeeId;
  }

  public void setPassword( String aPassword ) {
this.password = aPassword;
  }

  /**
  * @retrurn The employee password
  */
  public String getPassword() {
return this.password;
  }

  protected void resetFields() {
this.employeeId = "";
this.password = "";
  }

  /**
   * Validate the properties that have been set from this HTTP request,
   * and return an ActionErrors object that encapsulates any
   * validation errors that have been found.  If no errors are found, return
   * null or an ActionErrors object with no
   * recorded error messages.
   *
   * @param mapping The mapping used to select this instance
   * @param request The servlet request we are processing
   */
  public ActionErrors validate( ActionMapping mapping,
HttpServletRequest request ) {
ActionErrors errors = new ActionErrors();

// Check and see if the access number is missing
if( employeeId == null || employeeId.length() == 0 ) {
  ActionError newError = new ActionError( "errors.employeeId.required" );
  errors.add( employeeId, newError );
}

// Check and see if the password is missing
if( password == null || password.length() == 0 ) {
  ActionError newError = new ActionError( "errors.password.required" );
  errors.add( password, newError );
}
return errors;
  }
}


4) My environment:

Tomcat 4.1.10
Struts 1.1b2
Windows XP


I can provide web.xml and LoginAction.java if needed.

Much thanks in advance for your helps!

Tuan

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