Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

anything wrong with this JSP syntax ?

 
Artemesia Lakener
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<% String myPrefix="http://<%= request.getServerName() %>"; %>
<FORM action="<%= myPrefix %>/submit" method="POST">

It complains that
********
Unable to scan the character '/' which follows '%>' at line 2

******

what's wrong ?
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Artemesia Lakener:
<% String myPrefix="http://<%= request.getServerName() %>"; %>
what's wrong ?


Put this

<% String myPrefix="http://" + request.getServerName(); %>
 
Artemesia Lakener
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Chetan Parekh:


Put this

<% String myPrefix="http://" + request.getServerName(); %>


still same error. why ?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So why are you doing this in the first place?
 
Paul Clapham
Sheriff
Pie
Posts: 20755
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, let's de-complexify it even more:I don't know why the original was a problem, but then I am actively working on removing scriptlets from JSPs so I don't need to learn that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic