Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

JSP Tag Error

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to add a tag JSP for hands-on. But it is not working.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>First JSP</TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>

<BODY>
<FORM Action="LoginProcess.jsp">

Username : <input type="text" name="uname" value="<%= request.getParameter("uname")%>"/>

Password : <input type="password" name="password"/>


<INPUT type="submit" value="Login"/>

</FORM>
</BODY>
</HTML>

I am saving this file as Login.html
If login fails it returns to the same page as a error page. It is supposed to show entered username in the Username box.

But is is showing as

Username : <%= request.getParameter("uname")%>
Password :

Now if i change the file name to Login.jsp it works fine!

Why is that so?

Please do reply!

Output is coming as not expected in .html file

 
Marshal
Posts: 26750
81
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, yeah, you do have to name your file with a ".jsp" extension to have JSP processing done on it.
 
prathamesh bandivadekar
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But our tutor showed the same example in .html file!

Unfortunately he is not available for any comments!

So i was wondering how can we incorporate such jsp tags in .html file!
 
Sheriff
Posts: 67582
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unless you do a lot of serious fiddling with mappings and such, which I am sure that at this point is beyond the scope of your studies, you must use the .jsp file type. Otherwise, it's not a JSP.
 
Be reasonable. You can't destroy everything. Where would you sit? How would you read a tiny ad?
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic