Nathan, 

What I am going to do is 

A) Create a servlet that does nothing but queries the data (I know which
all tables are going to be used for Query), and load these data as
application scoped. This will be set in the web.xml as load on startup. 

B) Now in my JSP, I just build up the select list using <core:foreach (I
use mix of JSTL and struts taglib) on the application scoped variable .


C) Wherever I need a dynamic loading, I am going to show only one select
in one page, so that when the user does a continue on the previous page,
the action is forwarded to Action wherein I query the data and load it
as request scoped or session  scoped and then forward to this JSP. 

If you don't want the servlet in the as a load on startup, then you can
create an Action component and move the same logic to this Action
Component and forward to this Action component directly from the
index.jsp (to get into struts framework) and then from there forward to
your Login screen or whatever is your entry screen. 

Hope I am making sense :).  

-----Original Message-----
From: Nathan Maves [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 23, 2003 10:00 AM
To: Struts Users Mailing List
Subject: Re: Servlet call from JSP/HTML - Need help

I am looking to do just what you have proposed.  How do you preload the
action.

Nathan
On Wednesday, October 22, 2003, at 10:45  PM, Andrew Hill wrote:

> Well, if the values to show dont need to be dynamically loaded based 
> on other user input on that page then of course best practice is to 
> load them in the action before forwarding to the view. (If the values 
> dont change at all while the app is running then it would be even more

> efficient to load them into servlet context with a plugin at startup)
>
> We thought you needed to do some really complex db lookup based on 
> other fields in the same form that was too dynamic to effectively 
> preload results for.
>
> -----Original Message-----
> From: Shishir K. Singh [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 23 October 2003 12:35
> To: Struts Users Mailing List
> Subject: RE: Servlet call from JSP/HTML - Need help
>
>
> I went through them...However, I seeing the amount of Java sript that 
> may be involved, I am thinking of another approach. I have decided to 
> preload the independent select fields in an Action and then show the 
> JSP. This may result in the application starting a bit late but once 
> loaded, I will be dealing with static values and not variables. Also, 
> for select fields that are dependent on other select fields, I have 
> decided to show them one by one,
>
> Hence sequence of action will be
>
> 1 Action (Preload all independent Select) -> 2 forward to JSP-> 3 User

> submits > 4 Action Load  the dependent Selects -> goto 2
>
> Is this crude way of doing it??
>
>
>
>
> -----Original Message-----
> From: Andrew Hill [mailto:[EMAIL PROTECTED]
> Sent: Thursday, October 23, 2003 12:04 AM
> To: Struts Users Mailing List
> Subject: RE: Servlet call from JSP/HTML - Need help
>
> Another one worth reading on 'remote scripting' is:
> http://developer.apple.com/internet/javascript/iframe.html
>
> -----Original Message-----
> From: James Mitchell [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 23 October 2003 11:59
> To: 'Struts Users Mailing List'
> Subject: RE: Servlet call from JSP/HTML - Need help
>
>
> You mean like this?
>
>  http://www-106.ibm.com/developerworks/library/wa-resc/
>
>
>
> --
> James Mitchell
> Software Engineer / Struts Evangelist
> http://www.struts-atlanta.org
> 678.910.8017
> AIM:jmitchtx
>
>
>
>
>> -----Original Message-----
>> From: Shishir K. Singh [mailto:[EMAIL PROTECTED]
>> Sent: Wednesday, October 22, 2003 10:18 PM
>> To: Struts Users Mailing List
>> Subject: Servlet call from JSP/HTML - Need help
>>
>>
>> Hi,
>>
>> Is there anyway that I can call a servlet from a Select Input type.
>> The idea is that the moment  user clicks on the drop down of an 
>> <html:select> type, the option is populate by data queried from 
>> database ( this logic resides in a servlet). I think that I may have 
>> to use the onClick attribute, but I am not sure how to implement
this.
>>
>> Any pointers ?
>>
>> TIA
>> Shishir
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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


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

Reply via email to