permaculture playing cards*
The moose likes JSP and the fly likes JSP processing attribute in request object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP processing attribute in request object" Watch "JSP processing attribute in request object" New topic
Author

JSP processing attribute in request object

Jay White
Greenhorn

Joined: Apr 04, 2013
Posts: 2
Hey, I'm working on a web app a class that i'm taking and I've ran into a little trouble. The app is a mock up of a college registration for students. I have my login screen working and now I'm working on my registration page. When they click on the registration link in the menu, they are taken to a jsp where they are to select a subject from a combobox and submit which retrieve all the classes open for that subject. What I planned on doing was use the same jsp. They selected the subject and after processing with a servlet I wanted to send them back to the same jsp but display the classes under the comboxbox. I've written all the code for the server side processing but when it sends it back to the jsp, I'm unable to retrieve the classes with jstl.

I'm using netbeans and I'm really not familar with it. Usually what I'd do in a java app would be to insert System.out.println statements to see where the program is going wrong, but these statements don't show up in the debugger output in netbeans. I have each class stored in a ClassItem class I created and then use and arraylist to hold these ClassItems objects. What I wanted to do was to output the values to the output window to check if the values are being added correctly before I add the attribute to the request and send it back to the jsp. How do I go about doing that , or is there a better way of accomplishing this. Again I'm new so I'm not 100% sure of proper debugging tactics.


I did step through the app with the debugger and it seems that they are being added properly but I'm unsure if they are getting sent back to the jsp. In the jsp I used jstl to loop through the object and each class into a table but when debuggin it gets to the forEach loop and doesn't execute the code inside.

I'm going provide the code i'm working on, hoping someone can explain where I'm going wrong.


thanks
jay

JSP



SERVLET




DAO

Jay White
Greenhorn

Joined: Apr 04, 2013
Posts: 2
well of course a couple hours after I wrote this I happen to figure it out. I had a loop in my addClass() method to see if the class was already in the arrayList, turns out I coded it wrong and was not add any classes to the list causing nothing to be returned to the jsp.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60822
    
  65

Thanks for posting back with your findings!


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP processing attribute in request object
 
Similar Threads
How to fill select list from database table
Servlet throws Unload Exception
exception
Problem in using date in WHERE clause in SELECT query in Servlet.
How to retain selected value from dropdown list in same jsp page