Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Unterminated String error trying to append to a query  RSS feed

 
Rob Singley
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to append a hidden value to a query that I am passing using the following code:

<jsp:setProperty name="objSearch" property="query" value="<%=objBasicQuery.getCurrentQuery()%>" + "<%=strnewquery%>" />


This throws an unterminated string error

My original query works properly if I have just:

<jsp:setProperty name="objSearch" property="query" value="<%=objBasicQuery.getCurrentQuery()%>" />

Am I missing something?

Any help would be appreciated...
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your notation is incorrect. You can't add (concat) two scriptlet expressions.

Try something along the lines of:


[ September 23, 2004: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And I would be remiss if I didn't point out that manipulating queries in a JSP is considered very poor architectural practice.
 
Rob Singley
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the info...As you can probably tell I'm new to coding so the way I'm trying to do this may not be architecturally sound but it is the only way I can figure out how to get it to work until my coding skills improve...

BTW....I made the change you suggested and no longer get the error...my query hasn't changed but it may be due to the section of my code that is passing newquery...

Thanks again...
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you are ready, look up the terms "MVC" and "Model 2" in relation to web application architecture for some very good information on best ways to set up web apps.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!