tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lyallex <>
Subject Re: This is just plain ... odd.
Date Fri, 09 Nov 2012 09:00:46 GMT
> > I have a facade that publishes a method that contracts to return a
> > list of categories ordered alphabetically
> All problems in computer science can be solved by another layer of
> abstraction. Sure you can't fit a Proxy to a Service in there?
Hmm an oldie but goodie we can discuss software analysis and design if you
but it's a bit OT.

> [snip]

> What does that "custom tag" do? A beer says it sorts something. Or,
> maybe you have some silly client-side process that sorts the entries
> after they are loaded into the browser.

Well I quite like Wadworth 6X I'll give you my paypal account address and
you can deposit £3.30 :-))
I can assure you I'm quite familiar with my own code and no secondary sort
is going on.

As succinctly as possible

MySQL returns results sorted by primary key by default AFAIAA
no explicit sorting is done in the database access code

/* Category server (database access) */
public List<Category> getCategories(Connection conn) throws
String sql = "select * from Category";

populate list then return it NO SORTING

/* facade deals with transactional connections etc*/
public List<Category> getAllCategories() throws CategoryException
CategoryServer categories = new CategoryServer();
allcats = categories.getCategories(conn);

/* Initialization servlet */
CategoryFacade cats = new CategoryFacade();
List<Category> categories = cats.getAllCategories();
getServletContext().setAttribute(WebConstants.ALPHACATS, categories);

/* CategoryWriter custom tag */
List<Category> cats =(List<Category>)
Iterator<Category> iter = cats.iterator();
Category c = null;
StringBuffer buf = new StringBuffer();
           //build the output
//output it

That's it, really, there is no more

I need to get to the bottom of this as it's bugging the hell out of me
a pound to a penny says it's something simple/stupid. I'll try what you
suggest re wrapping the collection



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message