Dave Mere

Ranch Hand
+ Follow
since Oct 25, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Dave Mere

I think you're on the right track Bear; I've figured it out and it is indeed to do with the method of output. In this case I needed to set the escapeXml attribute of the c ut tag, thus:



Thanks for your help everyone
18 years ago
JSP
Hi Bill,

I'm afraid I'm not quite with you! So you're saying the "<" and ">" symbols aren't actually stored like that in my database? When I System.out.println them they look like that. Why does the IE source code read them differently?

For the code you provide, two questions;

Is ltSRep a string variable with the value "<"?
Shoudl matcher actually be "matches"? That's the only option eclipse gives me!

Thanks for you patience! Been a long week . . .
18 years ago
JSP
I added those spaces just for the post. The text in the database contains a standard tag : <I> Salvia </I>

It appears in the generated source code as:
& l t ; I & g t ; Salvia & l t ; / I & g t ;

I have added spaces for this post otherwise the text appears as <I>Salvia</I>. It's something to do with the way the browser is reading the symbols I think.
18 years ago
JSP
Hang on that's not how the source code appears at all! I'm adding a space between the characters to avoid that effect:



Hope that's clearer
18 years ago
JSP
Hi there,

I have an application that read text fields from an embedded database then passes these fields to a jsp for output. One requirement is that certain section of the text must appear in italics (latin plant names). My solution to this was to add a function whereby the users select the section of text to italicise, then my data management tool (an Access front end) adds <I> tags to the text stored in the database. So the stored text looks like:

This is one of over 900 species of <I>Salvia</I> that are found throughout the world.



Unfortunately, instead of outputting italicised text, the resulting jsp displays the tags literally as above - no italics, just the actual tags displayed. When I view the source code it look like this:



What's going on? How do I compensate for this?

Thanks, Dave
18 years ago
JSP
One of my colleagues gave me the same answer. It works doesn't it? Then do it! Perhaps I'm starting to think too much.

cheers brent
18 years ago
Oops - here's the code, formatted a little better . . .
18 years ago
Hi there,

I have a set of results returned to my jsp as a list of beans. Each bean contains one data field and the name of a thumbnail to find and display. The info needs to be displayed in a fixed table format, like so:

1 2 3 4 5
6 7 8 9 10

I can think of a few ways to acheieve this. For example, set an arbitary variable i to increment with each new record. When i = 6 add another <tr>.
Or, return the results as two sets of 5 and loop through the <logic:iterate> twice so I have two tables.

But both of these seem like applying sticking plasters to a problem that I should really solve! Can anyone suggest a better way of arranging these records in the above format?

Thanks, Dave
[ February 21, 2006: Message edited by: Dave Mere ]
18 years ago
I went for the quickest solution I could think of! This was to bring back the whole dataset and seperate it out into subsets of 10 in the servelet, using flags set in the jsp. It works well, but in my case I'm using a local database with a small dataset so performance lag doesn't occur.

If you mwere looking at a returned set of thousands or more this approach might start to strain. Presumably in this case you'd be looking at storing the resultset in session then manipulating it for each new page?

Anyone out there worked on pagination for large datasets?
18 years ago
Sorted! Cheers Sam.

And on that note, I'm off to the pub . . .
18 years ago
Hi there,

As part of my pagination efforts, I need to round up a number to work out how many pages I need. So, where results is my ArrayList:



This outputs;
18
1.0
1.0

So 18 records returned (ok). The divide by 10 . . . = 1.0? What's going on?

How can I round up 18/10? Or generally work out how many pages I need for my 18 record resultset?

thanks!

Dave
18 years ago
Hi there,

I've been looking at the past discussions on struts pagination, and there seem to be a lot of different approaches out there! I wondered if anyone might like to discuss the best way forward in my particular case?

It's a fairly simple application that returns an ArrayList to a jsp which then displays the info using struts-el and logic:iterate. The result set is likely to be say 40 records split into pages of 10. Thus:



So, my list composes of a series of sumAlpine beans which contain my data. I then create an image link based on these values which forwards to my next struts action, detailQuery.do.

I'd very much like to keep this current method of displaying my info, as it's one I'm comfortable with and time is tight! What would be the best way of proceeding with paginating this?

thanks for looking!

Dave
18 years ago
Hi there. Having searched the archives a popular solution to paginantion in struts seems to be to use "Pager Tag Library" from www.jsptags.com. Has anyone actually implemented this approach? I'd like to know what kind of results people got before diving in with it myself.

Thanks!

Dave
18 years ago
Hi there,

I'm setting up a struts app with connection variables stored in the web.xml file. I find that when I access these from my DataLayerServlet on startup, the variables can be found, but when I try to read them from my QueryAction during runtime, the same retrival string returns null.

Here's the string I use to access the variables from my QueryAction:


and the web.xml entry :


What am I missing? Why can the program detect the variable at startup but not at runtime?

Thanks! Dave
18 years ago
Got it. The closest equivalent in Derby is the CLOB datatype.
18 years ago