• Post Reply Bookmark Topic Watch Topic
  • New Topic

Not understanding the logic

 
william chaple
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok pretty much I am looking up controllers for jsp (basic basic basic types)

I pretty much have 4 pages

I have edit ---> confirm ----> process and all these communicate with the controller which the code is




but I am a bit lost because I am not sure if I should keep the edit page as a user input or I have this code as I am reading but not sure if that also goes in the controller.jsp

Capture.JPG
[Thumbnail for Capture.JPG]
what I am trying to do now
confirm.JPG
[Thumbnail for confirm.JPG]
page to confirm (whether to edit or process)
process.JPG
[Thumbnail for process.JPG]
If you processed, then it just displays as processed so you transfer the information from confirm to process.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65518
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using a really old reference?

Using JSPs as controllers, or putting any Java code in a JSP, has been considered obsolete and a really poor practice for over 12 years now.

I would advise learning how to use servlets as controllers.
 
william chaple
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh I saw servlets in the book I was reading, but it was just going step by step. I am just trying to go step by step, I guess to exercise my brain ha ha. Servlets were next after this part. But can someone help me out? It said not to use EL in the other pages. I dont know I am a bit lost

I can send my entire code for each page if that helps?
 
william chaple
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
william chaple wrote:Oh I saw servlets in the book I was reading, but it was just going step by step. I am just trying to go step by step, I guess to exercise my brain ha ha. Servlets were next after this part. But can someone help me out? It said not to use EL in the other pages. I dont know I am a bit lost

I can send my entire code for each page if that helps?


ok never mind i figured it out
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65518
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem with learning in this way is that it's likely to instill bad habits that are hard to break later.

Be aware that in modern web applications, best practices dictate that JSPs should be used for views only (not controllers or anything else), and that Java scriptlets not be used in JSP pages.

Be sure to update your references to those that emphasize this approach, and that use the JSTL and EL in JSPs in lieu of Java scriptlets.

You might want to give these articles a read:
  • The Secret Life of JSPs
  • The Front Man

  •  
    william chaple
    Ranch Hand
    Posts: 135
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Bear Bibeault wrote:The problem with learning in this way is that it's likely to instill bad habits that are hard to break later.

    Be aware that in modern web applications, best practices dictate that JSPs should be used for views only (not controllers or anything else), and that Java scriptlets not be used in JSP pages.

    Be sure to update your references to those that emphasize this approach, and that use the JSTL and EL in JSPs in lieu of Java scriptlets.

    You might want to give these articles a read:
  • The Secret Life of JSPs
  • The Front Man



  • ok ill take this advice, but what is JSTL?
     
    Bear Bibeault
    Author and ninkuma
    Marshal
    Posts: 65518
    105
    IntelliJ IDE Java jQuery Mac Mac OS X
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    JSTL == JSP Standard Tag Library

    EL == Expression Language

     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!