• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is declaring variable access modifiers in JSP is good?

 
Kishor Joshi
Ranch Hand
Posts: 674
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there

I have designed a JSP page which contain some java code in it(database constraints and functions)


this is my connect.jsp file


1)do I need to add something like private in all these variables.
Because I am including this jsp file in my many JSP pages?

2)Is this right way to declare constants and java functions in JSP?

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you using scriptlets 13 years after they have become obsolete? 13 years!

2) No. See above.
 
Kishor Joshi
Ranch Hand
Posts: 674
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks

My many questions are Interfernced
http://www.coderanch.com/t/649927/JSP/java/approach-news-sections

So suppose I have design a Front end for add News Section their are model class for users,topics,categories,replies.

I have Interlinked them

Suppose a user wants to add a Post suppose newPost.jsp so after writing post when he click on add button then I will process that code on my jSP(database operations is on a seprate model class)
or pass that to a servlet that will process more
?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSPs are for view, not processing. So it's never a question. Processing never happens in a JSP.
 
Kishor Joshi
Ranch Hand
Posts: 674
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks @Bear

You can close some of my recent posts and make only one active
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!