aspose file tools*
The moose likes JSP and the fly likes anything wrong with this JSP syntax ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "anything wrong with this JSP syntax ?" Watch "anything wrong with this JSP syntax ?" New topic
Author

anything wrong with this JSP syntax ?

Artemesia Lakener
Ranch Hand

Joined: Jun 21, 2005
Posts: 162
<% 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

Joined: Sep 16, 2004
Posts: 3636
Originally posted by Artemesia Lakener:
<% String myPrefix="http://<%= request.getServerName() %>"; %>
what's wrong ?


Put this

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


My blood is tested +ve for Java.
Artemesia Lakener
Ranch Hand

Joined: Jun 21, 2005
Posts: 162
Originally posted by Chetan Parekh:


Put this

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


still same error. why ?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60046
    
  65

So why are you doing this in the first place?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18115
    
    8

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.
 
 
subject: anything wrong with this JSP syntax ?
 
Similar Threads
custom tag question
JSTL - Configuration.
Doubt in syntax for taglib uri !!
XML Schema prefix - xs (or) xsd
CMS - Approach to handle requests using directory names