moving/tailoring struts-example app

2001-06-16 Thread joey sark

joey sark <[EMAIL PROTECTED]> wrote:
> Newbie question:
> 
> I'm using tomcat 3.2.1
> 
> my default app is webapps/Root
> 
> i have webapps/struts-example working.
> 
> my understanding is that these are two separate apps each with its own
web.xml
> etc, and that they cannot access each other's session data. I want to move
> struts-example to under /Root/ on the assumption that this is true.
> 
> I'm not clear on the organization of 'sub apps'for lack of a better term
and
> most examples i've seen show only monolithic apps, so restructuring this
> involves some guesswork.
> 
> I believe i have to proceed as follows, but please stop and correct me if
this
> is wrong:
> 
> 1. copy the webapps/struts-example tree to webapps/Root/my-struts
> 
> 2. now Root/my-struts/WEB-INF/web.xml is not used, so paste the pertainent
> parts into Root/WEB-INF/web.xml
> 
> 3. not sure if struts-config.xml and all the other .xml's and .tld's need
to
> be moved to Root/WEB-INF/ or stay put.
> 
> 4. since webapps/struts-example still exists, seems like there would be a
> servlet name clash with the new subapp, and also a servlet mapping clash.
what
> do i do about this? 
> 
> it would not seem right to rename the new "action" servlet but it does seem
> necessary to map it to something like /myaction/*.do - 
> 
> 5. seems like it's ok to leave the new /my-struts/WEB-INF/lib and /classes
> just as they are.
> 
> can someone please advise me if this is the way to do it? there are a dozen
> new unknowns introduced here that could break the whole thing and be really
> difficult to trace.
> 
> thanks a zillion!
> 
> end
> 
> 
> Get free email and a permanent address at http://www.netaddress.com/?N=1


end


Get free email and a permanent address at http://www.netaddress.com/?N=1



RE: General DATABASE programming question

2001-06-16 Thread Mindaugas Idzelis


> I know it sounds wasteful, but personally I would think about getting a
> page at a time. This is more work on the DBMS as they go to later pages,
> but many times they don't go past the first page. Otherwise you will
> need to keep the resultset in the session and tie up memory.
>
> A lot of people like to use the pager tag from JSP tags for this sort of
> thing.

My original goal is to ask the database for a page of information at a time.
However, MS SQL server does not let you display your results starting at an
offset.

In my web app's search method, I load the ResultSet into a LinkedList and
use the struts iterate taglib to display the results to the JSP tags pager
taglib.

So, I see two ways of resolving this. 1) Do the query one time and store the
LinkedList in the session -- effectively caching the entire results in
memory. 2) Query the database each time and skip over the first n results
and discarding the last x results.

Neither of these solutions are really ideal since the the ammount of results
I expect to return are in 1,000 range.

So, is it time to pick a better database? Thanks.


> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel 716 737-3463.
> -- http://www.husted.com/about/struts/
>
>
> Mindaugas Idzelis wrote:
> >
> > Thanks for all your answers. This has been very nerve wrecking.
> I think I've
> > come up with a solution that may work in a DB independent way.
> I'll use a
> > scrollable resultset. I won't iterate through all of it, only
> portions at a
> > time. I think most underlying JDBC drivers use "cursors" to
> implement the
> > scrollable resultset. Is this a valid approach?
> >
> > --min




Re[2]: General DATABASE programming question

2001-06-16 Thread Oleg V Alexeev

Hello Mindaugas,

Saturday, June 16, 2001, 10:36:45 PM, you wrote:

MI> My original goal is to ask the database for a page of information at a time.
MI> However, MS SQL server does not let you display your results starting at an
MI> offset.

MI> In my web app's search method, I load the ResultSet into a LinkedList and
MI> use the struts iterate taglib to display the results to the JSP tags pager
MI> taglib.

MI> So, I see two ways of resolving this. 1) Do the query one time and store the
MI> LinkedList in the session -- effectively caching the entire results in
MI> memory. 2) Query the database each time and skip over the first n results
MI> and discarding the last x results.

MI> Neither of these solutions are really ideal since the the ammount of results
MI> I expect to return are in 1,000 range.

MI> So, is it time to pick a better database? Thanks.

I think you have next variants -

1. Cach results in session (if you have large amount of memory - it is
   your way) or in application scope (if you use static data set).
2. Write stored proc in SQL Server -
   by the stored proc you can query database, scroll to the target row
   and return limited count of rows
3. Query database directly -
   you can scroll directly - via ResultSet.absolute(int) - if your
   JDBC driver supports scrollable result sets, or scroll manually -
   via ResultSet.next().

-- 
Best regards,
 Olegmailto:[EMAIL PROTECTED]





Re: General DATABASE programming question

2001-06-16 Thread Martin Cooper

We use SQL Server, and we use your option (2). As long as you use scrollable
cursors, you're not actually retrieving everything, just what you need. You
can also use TOP to help limit the query. Some of our queries are against
tables with many millions of rows, and the result sets can contain millions
of entries. Still, as long as the database is set up properly, the queries
and retrieval are fast.

--
Martin Cooper


- Original Message -
From: "Mindaugas Idzelis" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, June 16, 2001 11:36 AM
Subject: RE: General DATABASE programming question


>
> > I know it sounds wasteful, but personally I would think about getting a
> > page at a time. This is more work on the DBMS as they go to later pages,
> > but many times they don't go past the first page. Otherwise you will
> > need to keep the resultset in the session and tie up memory.
> >
> > A lot of people like to use the pager tag from JSP tags for this sort of
> > thing.
>
> My original goal is to ask the database for a page of information at a
time.
> However, MS SQL server does not let you display your results starting at
an
> offset.
>
> In my web app's search method, I load the ResultSet into a LinkedList and
> use the struts iterate taglib to display the results to the JSP tags pager
> taglib.
>
> So, I see two ways of resolving this. 1) Do the query one time and store
the
> LinkedList in the session -- effectively caching the entire results in
> memory. 2) Query the database each time and skip over the first n results
> and discarding the last x results.
>
> Neither of these solutions are really ideal since the the ammount of
results
> I expect to return are in 1,000 range.
>
> So, is it time to pick a better database? Thanks.
>
>
> > -- Ted Husted, Husted dot Com, Fairport NY USA.
> > -- Custom Software ~ Technical Services.
> > -- Tel 716 737-3463.
> > -- http://www.husted.com/about/struts/
> >
> >
> > Mindaugas Idzelis wrote:
> > >
> > > Thanks for all your answers. This has been very nerve wrecking.
> > I think I've
> > > come up with a solution that may work in a DB independent way.
> > I'll use a
> > > scrollable resultset. I won't iterate through all of it, only
> > portions at a
> > > time. I think most underlying JDBC drivers use "cursors" to
> > implement the
> > > scrollable resultset. Is this a valid approach?
> > >
> > > --min
>





Web design with taglibs?

2001-06-16 Thread Thomas Corte


Hi,

the Struts template taglib obviously addresses the design
of a web page at large, e.g. menu/header/content/footer,
and does a good job here.

However, I'd like to use templates at a smaller scale,
e.g. use a template for a small HTML fragment containing an
anchor tag with an image which occurs on many pages.

As the struts templates are not built for this task,
I find myself writing my own tags which merely print out
little or huge amounts of literal HTML code in the doStartTag and doEndTag
methods.

Is this the preferred method for my task? It's not really elegant,
even if I'd replace the print("<...>") stuff by equivalent
ECS method calls.

Regards,

_
 |   |
 | knipp |   Knipp  Medien und Kommunikation GmbH
  ---   Technologiepark
Martin-Schmeisser-Weg 9
D-44227 Dortmund
 Dipl.-Inform. Thomas Corte Fon: 0231-9703-0
 [EMAIL PROTECTED]Fax: 0231-9703-200





Re: [ANNOUNCEMENT] Struts 1.0 (Final) Released

2001-06-16 Thread Michael Mok
Title: RE: [ANNOUNCEMENT] Struts 1.0 (Final) Released



Congratulations to Craig and the team!
 
Cheers
 
Michael Mokwww.webappcabaret.com/teatimej
 


Re:

2001-06-16 Thread Rod Schmidt

Does this mean you can't default a checkbox to true? If you can, how do you
do it?

Thanks,
Rod Schmidt

- Original Message -
From: "Ted Husted" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 15, 2001 5:45 PM
Subject: Re: 


> They are actually "cached" in the request. It's just that with boolean
> checkboxes, you should reset them them to false first, or there are side
> effects. You really, really don't have to do anything else.
>
> It's important to remember that there is not a direct connection between
> the HTML form and Struts. Everything has to go through HTTP. When the
> form is submitted, all the properties are sent as parameters to the
> request by HTTP. Struts then "catches" them and puts them back into the
> ActionForm.
>
> What can happen with checkboxes is that if they get unchecked, the
> browser won't send them back, and so Struts has no way to set them true
> or false. By setting them to false when the form is initialized and to
> false again when the form is reset, you get consistent results.
> Otherwise, if they unchecked the box, and the browser didn't send it
> back, the setting on your box may be indeterminate.
>
> Mike Thompson wrote:
> >
> > So this means that I have to cache the original state of all my checkbox
> > referenced vars so I can set them back in the reset method? :(
> > --m
>