Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet/JSP Model

 
Tom Hilliard
Ranch Hand
Posts: 39
Netbeans IDE Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I posted here the other day with a servlet/jsp problem.

Some guys helped me find the problem and fix it! Great!

Now, by posting some of my code, the repliers (Satya Maheshwari & Bear Bibeault cheers) made me aware of my bad code (java scriptlets in jsp) and that I was using a model that was outdated (cheers uni for teaching me old tech!).

At first I was adamant that I wouldn't change my code and that it was fit for purpose. I now realise this is a poor attitude to take and that I should learn the "best" model.

So my question is, could you point me to some material (easy to digest) that can help me learn this model? And if I found myself struggling, could I post some of my code and get some help translating it to the new model? I do usually find it much easier to understand if I can see some working code

Regards

TH

PS. If this post is in the wrong section please move it to where it belongs
 
Vijitha Kumara
Bartender
Posts: 3913
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can find some basic details in the ServletFAQ section.
And if I found myself struggling, could I post some of my code and get some help translating it to the new model?

Of course, folks here are always very much helpful
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64824
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I already linked you to this article. Feel free to ask about any aspects of web app structure that you are not understanding.
 
J. Kevin Robbins
Bartender
Posts: 1759
19
Chrome Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pick up a copy of "Head First Servlets & JSP". I think you'll find that it's exactly what you are looking for.
 
Tom Hilliard
Ranch Hand
Posts: 39
Netbeans IDE Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the replies guys, I'm now reading the materials you have provided.

I will have a go at implementing something and get back to you guys for some feedback

Regards

TH
 
Tom Hilliard
Ranch Hand
Posts: 39
Netbeans IDE Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jk Robbins wrote:Pick up a copy of "Head First Servlets & JSP". I think you'll find that it's exactly what you are looking for.


Ive got this book now and am now implementing the first simple exercise (beer-V1) and I'm struggling with the deployment directory (page 72/73)!

Now what I'd like to know is are those things described "folders" or "packages" because I've followed the guidance and implemented the beerselection.html, web.xml and BeerSelect.java and my project won't deploy or run!
Mentions this in the console - FAIL - Deployed application at context path /FinalProject but context failed to start. C:\Users\Tomo\Documents\NetBeansProjects\FinalProject\nbproject\build-impl.xml:683: The module has not been deployed.
And points to this in build-impl.xml <nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>

So I'm thinking my deployment directory isn't right!?

Regards

TH
 
Tom Hilliard
Ranch Hand
Posts: 39
Netbeans IDE Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorted it, seems my deployment environment wasn't right!

This model seems much more complicated to actually get on and write code but even from this simple example I can see how maintenance and testing becomes much easier. I suppose I can always get better at coding/understanding the model, but no matter how good I am at maintaining/testing, if the code is in the mess I originally intended it will always be difficult.

Will keep you guys posted on Model 2 progress

Regards

TH
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic