Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to Use HTML tags in between scriptlets without println  RSS feed

 
Ranch Hand
Posts: 106
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Community!

I want to add some HTML-Tags between my java-scriptlet-tags.
But I dont wanna use the expression language right now.

This is my code:



I just want to use these HTML-Tags without using "println".



I hope you can help me!
Thank you very much

 
Author and ninkuma
Marshal
Posts: 66727
167
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Scriptlets have been obsolete for over 15 years. you should be using the JSTL and EL in JSP pages.

In any case, anything that's not a JSP element is part of the template (in this case, the HTML), so just put the HTML code outside any scriptlet or other JSP element.

To understand how JSP operates please see this article.
 
Ralf Coby
Ranch Hand
Posts: 106
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much
 
Bartender
Posts: 19553
90
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By using the JSTL "if" tag, you can code this without any Java scriptlet code at all.

Regardless, as a login page, a hacker could shred it in little or no time.

Don't write your own login system. Use the J2EE container security standard or at least a reputable third-party security package. If you're not a full-time trained security professional, it's very, very unlikely that you're going to produce a secure system, no matter how clever you think you are.
 
Ralf Coby
Ranch Hand
Posts: 106
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for the tips!
 
I wish to win the lottery. I wish for a lovely piece of pie. And I wish for a tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!