Opening page in a new window

2002-04-01 Thread Sudipta Sarkar

Hi,
  I have a application with the following feature:

  I have a form with some text fields and a submit button.
  When I press submit I need to do some database interaction and the result of
that I store in seesion.
  The results then  need to be displayed on a different page on a new browser
window.

  What I did is:
   In the action class did the database calls and the put the results in
session.
   The JSP page uses the results present in the session (which was populated
in the action class) and displays them.
I have used something like the following
  
 to open the jsp page in a new window.(openReportwindow is my javascript
function which open a new window)
  What is happening is that the jsp page is saying bean not found in session
and that is because the jsp page is trying to get the bean before the
action's perform method has finished and hence its not finding the bean.
What should I do in order the jsp page tries to get the session variable/beans
after the perform method has finished i.e the data in put into session from
the database.  
 
Thanks in advance.
Sudipta  


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




Re: [Re: [Re: how to dynamically change form in a tag]]

2002-03-22 Thread Sudipta Sarkar

 No this also does not work.
"Nicolas De Loof" <[EMAIL PROTECTED]> wrote:
Does 
   "> 
work ?




The solution you said works.
but 
   "> does not work
although
   <% String id = (String)request.getParameter("id"); %>
   
  works.
Is there anything that I am doing wrong in case 1.

Thanks
Sudipta  




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




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




Re: [Re: how to dynamically change form in a tag]

2002-03-22 Thread Sudipta Sarkar

The solution you said works.
but 
   "> does not work
although
   <% String id = (String)request.getParameter("id"); %>
   
  works.
Is there anything that I am doing wrong in case 1.

Thanks
Sudipta  

"Nicolas De Loof" <[EMAIL PROTECTED]> wrote:
JSP Tags use an XML syntax, so you must have the same number of opening and
closing "html:form" jsp tags in your jsp. This is why your JSP engine
failed.

acording to struts-form.tld, action attribute in html:form tag can be JSP
computed. Try this:

<%
String actionPath;
if( something) {
actionPath =" /AccountMaint";
}
else {
actionPath =" /CreateAccount";
}
%>




..






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




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




Re: How do I pre-select an element from a select list?

2002-03-21 Thread Sudipta Sarkar

Step 1.
  In JSP
  
   
  

Step 2.
  the formbean has methods getLabels and getValues()

  public Collection getLabels()
{
ArrayList a = new ArrayList();
a.add("One");
a.add("Two");
a.add("Three");
return a;
}

public Collection getValues()
{
ArrayList a = new ArrayList();
a.add("1");
a.add("2");
a.add("3");
return a;
}

Step 3.
  Notice the value attribute of  .This is the value to compare 
with for marking an option selected. Since I have specified value="2" so 
option "Two" will be selected.

Thanks
Sudipta

>From: Struts Newsgroup (@Basebeans.com) <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: How do I pre-select an element from a select list?
>Date: Thu, 21 Mar 2002 13:55:02 -0800
>
>Subject: How do I pre-select an element from a select list?
>From: "Scott Danzig" <[EMAIL PROTECTED]>
>  ===
>Hi,
>
>Using Struts, I'm able to create an instance of a form, and prepopulate it
>with various information, then have it display this information in HTML
>spawned from a JSP page after the forward("success").  I'm unable, however,
>to figure out how to pre-select an element from a select list.  Like if a
>dropdown html SELECT menu displayed "First", "Second", and "Third", I'd 
>want
>to be able to have the form displayed with "Second" already selected.  
>Given
>I'm rather new to struts, let alone EJB and servlets, could someone please
>explain very clearly about how to do the three steps involved with this?
>First, adding the get/set functions to the form class.. what arguments 
>would
>they take?  Second, how to add the html:select and html:options tags to the
>JSP page so that I can prefill them with this form class, and lastly, in 
>the
>Action class which I have querying another datasource and retrieving this
>information, setting the necessary things in the form class, what
>property/attribute do I set in this form object, to have it preselect an
>element in the select list?  Thanks.
>
>Scott Danzig
>[EMAIL PROTECTED]
>
>
>
>--
>To unsubscribe, e-mail:   
>
>For additional commands, e-mail: 
>
>




_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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




Struts html taglib

2002-03-21 Thread Sudipta Sarkar

Hi,
  I am using struts 1.0.2 on weblogic 6.1sp2 jdk1.3.1.
I am facing the folowing problem:

" />
does not work. This does not even render the textbox. The generated html is
.
If I replace the double-quotes around mybean and firstname by single-quotes 
then the value of the text field becomes .
The generated html is

This means ot did not even recognize the jsp:getProperty tag.
But if I use simple html tags instead of struts html tag library and use 
something like the following
" />
then it works properly and the value of the text field becomes the value of 
the property named firstName of the bean mybean.

IS it a bug in html tags library or am I doing something wrong.

Thanks
Sudipta


_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


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