× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




> -------- Original Message --------
> Subject: RE: JSPs and Property Files
> From: "Joe Pluta" <joepluta@xxxxxxxxxxxxxxxxx>
> Date: Fri, September 02, 2005 10:08 am
> To: "'Java Programming on and around the iSeries / AS400'"
> <java400-l@xxxxxxxxxxxx>
> 
> > From: michael@xxxxxxxxxxxxxxxxxx
> > 
> > Here's the section of the jsp...
> > 
> > <td id="WC_AdvancedCatalogSearchForm_TableCell_14">&nbsp;&nbsp;
> >             <select name="keyword_searchTerm">
> >             <option value="" selected>any keyword</option>
> >             <%
> >             for (int k = 1; k <=
> > Integer.parseInt(keywordText.getString("KEYWORD_NUM") ); ++k )
> >             { %>
> >                         <option
> > value="<%=keywordText.getString("KEYWORD_" + k
> > )%>"><%=keywordText.getString("KEYWORD_" + k )%></option>
> >             <%
> >             }
> >             %>
> >             </select>
> > </td>
> 
> Actually, assuming that keywordText is a properties file, this
> particular code simply dumps the values.  It doesn't show where
> keywordText is loaded.  In a JSP Model II approach, you would see
> "keywordText" as the ID attribute of a useBean tag somewhere.
> 
> Also, just a thought, but I'd highly consider wrapping that particular
> code in a class and calling it.  Building a SELECT is something you do
> over and over, and the interleaved HTML/Java code is just too prone to
> mistakes and errors.  For example, what if there is no entry for
> KEYWORD_NUM, or it contains invalid data? 
> 
> Joe
> 
> -- 
> This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) 
> mailing list
> To post a message email: JAVA400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/java400-l
> or email: JAVA400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/java400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.