aspose file tools*
The moose likes Servlets and the fly likes hidden variable syntax not working in servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "hidden variable syntax not working in servlets" Watch "hidden variable syntax not working in servlets" New topic
Author

hidden variable syntax not working in servlets

puja shaw
Ranch Hand

Joined: Nov 06, 2012
Posts: 32
can anyone please run the above example and tell me why it isnt working.I found out that the problem is with the hidden variable syntax.If so ,please can anyone tell me the solution for the below program th work.











Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Welcome to JavaRanch puja shaw.

I have applied code tag to your post to make more readable.

Coming to your question, yes as you smelled the problem is in hidden tag .
*scriptlet is for jsp not for servlet * . here scriptlet is not required. you can use variable directly as in
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12825
    
    5
<servlet-class>MyCookieExample</servlet-class>


I do hope that is not your real web.xml - ALL classes used in a servlet or jsp MUST be in a package. The reason being that if no package is specified, the JVM looks for a class file in the "current" directory, something you have no control over in a server environment.

Bill
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61657
    
  67

Why are you emitting HTML from a servlet rather than using a JSP?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
puja shaw
Ranch Hand

Joined: Nov 06, 2012
Posts: 32

Yes i understand my mistake now.Thankyou very much for helping me.My program did work fine now.Thankyou for fixing it for me.
puja shaw
Ranch Hand

Joined: Nov 06, 2012
Posts: 32
Yes Mr bill.Thankyou very much for your suggestion.I will keep this in mind and i will make sure that next time when i write servlets ,i will put them in a package.Thankyou.
puja shaw
Ranch Hand

Joined: Nov 06, 2012
Posts: 32
Actually i havent yet started using jsp's.Right now i am practising servlets.Thats the reason i used static content in servlets.But i agree that this is not a good idea.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: hidden variable syntax not working in servlets