Results 1 to 1 of 1
- 03-07-2010, 09:17 AM #1
Member
- Join Date
- Oct 2009
- Posts
- 16
- Rep Power
- 0
How to show class initialize data in JSP ?
I create a search.jsp and I need some how connect to this EstoreClientApplication.java to get all ProductType then use HTML drop menu to show in form what I should do ? Please Help !
Java Code:<form method="GET" action="./SearchProducts"> <select name="ProductType"> <option value="TV/Video">TV/Video</option>........ </select>
I have few class under com package
product.java (have all get set golbal value)
producttype.java (have all get set golbal value)
EstoreClientApplication.java (this provide by someone and I have to use it) look like below
Java Code:public class EstoreClientApplication { public static void main( String[] args ) { ArrayList<User> myUserList = new ArrayList<User>(); initializeUser(myUserList); ArrayList<ProductType> myProductTypeList = new ArrayList<ProductType>(); ProductCatalog pc = new ProductCatalog(); initializeProductType(myProductTypeList); // initializing ProductTypeList public static void initializeProductType(ArrayList<ProductType> myProductTypeList){ ProductType pt=null; pt = new ProductType (1, "TV/Video", "TV and Video Products"); myProductTypeList.add(pt); pt = new ProductType (2........... } public static void printProduct(Product product) { System.out.print("ID: " + product.getProductID() + ", Name: " + product.getProductName()+ "\t" ); System.out.print( ", Description: " + product.getDescription() + "\t" + ", Price: " + product.getPrice() + "\t" + ", Available Units " + product.getUnitAvailable()+ "\t"); if (product.getInStockFlag()) System.out.print( ", In Stock " ); else System.out.print( ", Not in Stock"); System.out.println( ", Type: " + product.getProduct_type_id()); } // End of the printProduct method public static void printMyProductList(ProductCatalog pc) { int i = 0; Iterator<Product> iter = pc.getProductList().iterator(); while(iter.hasNext()) { Product myProd = iter.next(); System.out.print("Product: " + ++i); if (i < 10) System.out.print(" "); System.out.print(" is: "); printProduct(myProd); } System.out.println ("\n"); }// End of the printMyProductList method }
Similar Threads
-
How can I show my log class in jTextArea
By mtz1406 in forum AWT / SwingReplies: 4Last Post: 10-29-2009, 12:15 PM -
help me to store data in a class
By neeraj.singh in forum New To JavaReplies: 2Last Post: 08-06-2009, 08:31 AM -
Data from a model class won't show up in the table
By ayampanggang in forum AWT / SwingReplies: 3Last Post: 11-27-2008, 08:20 PM -
Beginner; Create a class to store info and constructor to initialize
By badness in forum New To JavaReplies: 16Last Post: 05-08-2008, 09:45 PM -
netbeans 6.0 not show commpunent or show blank page
By fahimaamir in forum NetBeansReplies: 1Last Post: 01-26-2008, 06:20 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks