• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling a servlet

 
Popescu Ion
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
I had created a servlet, named "Download" , package: "servlets".
What is the expresion for calling the servlet from a jsp page, let's say index.jsp?
And if I do something like this :

it will be initializate in the general servlet or my Download servlet, or both ?
Thnx in advance
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the future please ask one question per topic.

Popescu Ion wrote:I had created a servlet, named "Download" , package: "servlets".
What is the expresion for calling the servlet from a jsp page, let's say index.jsp?

You don't "call" servlets, so I'm not sure what you are trying to do. Generally, there will be a link or form on the page that invokes the servlet via its URL.

And if I do something like this :

it will be initializate in the general servlet or my Download servlet, or both ?

That will have nothing whatsoever to do with your servlet. All it will do is to assign a string to an instance variable.

By the way, putting Java code in a JSP is an extremely poor practice that has been discredited for almost 10 years now. Why are you doing it?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic