• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help Clean up This Code

 
Garrett Smith
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The code is working fine but is there a cleaner strategy using tag files that is simple(r)?

The idea is to make a quiz where the form submits to the same page and displays the results, allowing the user to try again until he gets the right answer. This is a one-off, but I still like to keep the jsp clean anyway.



 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simpler? No. Cleaner? Substantially, depending on how far you want to go--don't even need custom tags, just pay attention to what you're doing:It's the same philosophy as refactoring Java: find yourself repeating yourself yourself? Eliminate duplication and obfuscation.(Notice also that using a label tag around something that isn't a label is silly.)Meh--diminishing returns. If you're going to go this far, just use JSP templates.
 
Mukhi Vla
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Meh--diminishing returns. If you're going to go this far, just use JSP templates.


What is jsp template? I am asking this question because i want to implement mail client program using spring and jsp. I thinking of having a jsp template that have mail template in it. But i have no idea how to create a jsp template....

Thanks
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
c:import/c:params
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic