473,513 Members | 2,524 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

jsp string syntax

57 New Member
How to escape double quotes within a string to include the value of a variable from a JSP?

Two variables, "start" and "end" are dates from a calendar function. I need the variable "query" to update with the start and end variables but can't get it to work.

Expand|Select|Wrap|Line Numbers
  1.  
  2. String     Start = request.getParameter("start");
  3. String     End   = request.getParameter("end");
  4.  
  5.  
  6. if ((Start != null) && (!Start.equals("")) || ((End != null) && (!End.equals(""))))
  7.     {    
  8.     query += "+AND+NEAR{Start,End}:MODIFIED";
  9.     }
  10.  

I tried encoding the curly brackets because I need them in the output like %7B${start},${end}%7D but that doesn't work either. Also tried a variety of quotes.

Thanks for your suggestions
Jul 29 '14 #1
2 2167
keydrive
57 New Member
I understand how to return the value of a variable in JSP. I'm just having problems escaping the double quotes required on the query += line.

Expand|Select|Wrap|Line Numbers
  1. <%=Start%>
Jul 29 '14 #2
keydrive
57 New Member
Solution:

Expand|Select|Wrap|Line Numbers
  1. query += "+AND+NEAR{" + Start + "," + End + "}:MODIFIED";
  2.  
Jul 29 '14 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1902
by: jez123456 | last post by:
Hi I'm attempting to pass a string into another string but I get an error This code work ok jro.CompactDatabase(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Compact.mdb", @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\tempdb.mdb;Jet OLEDB:Engine Type=5"); However when I declare a string and try to pass that I get an error
1
1295
by: jez123456 | last post by:
I have the following code which runs ok Jet OLEDB:System Database=C:\\Test\\system\\Sys.Mdw; When I use Jet OLEDB:System Database=@C:\Test\system\Sys.Mdw; or Jet OLEDB:System Database=@"C:\Test\system\Sys.Mdw";
4
2050
by: D. Shane Fowlkes | last post by:
I'm trying out a whole bunch of new (to me) techniques. Using asp.net 2 (vb), can someone correct my connection syntax. The problem seems to be that I'm not properly referening the config settings in my aspx page. Thanks! Compiler Error Message: BC30456: 'connectionStrings' is not a member of 'Configuration'. strConnectString =...
2
2938
by: Diana | last post by:
I thought I had this process pretty well down pat, but I'm getting a syntax error on the following code: *****Code***** 'Check for users - can't get this to work... Dim strUser As String strUser = WUserName() If IsNull(DLookup("Permitted", "tblUsers", "Permitted = '" &
2
15185
by: a.r.austin | last post by:
There was some PHP built in syntax method to enter huge strings as blocks of text. I don't remember exactly how it goes and not many people use it, thus, google search was unsuccessful to me: $a = text text text ;
0
1199
by: madeofrose | last post by:
How can i change classic asp pages' query string syntax? ------------------------------------------------------------------------------------ Hi i give a sample below original query string : www.qs.com/mypage.asp?pagenumber=2 i want to change it to : www.qs.com/mypage.asp/pagenumber.2
3
12158
priyan
by: priyan | last post by:
hai everybody, I need to copy data from a text file to a table i used copy command like this copy city from 'e\ccccc.txt' with delimiter as ',' it worked successfully. But now i need to copy a data from a text file which is in my system to the database in server..
7
1570
imrosie
by: imrosie | last post by:
Hello, I'm getting syntax error with this, does anyone see a glaring problem? I thought it was fine, but the compiler is complaining. thanks in advance. Private Sub custname_AfterUpdate() Me.FilterOn = True Me.Filter = "CustomerID =" & custacct Me.Requery End Sub
4
18484
by: Lucanos | last post by:
Hey Guys, Probably a simple question, but one I am struggling with all the same. I know that in PHP you wrap a text string in apostrophes or quotations - (examples $variable = 'this string' OR $variable = "that string" ). What I am trying to figure is how to handle a string which contains both apostrophes and quotations already. Is there...
2
3181
by: splendid9 | last post by:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14' Incorrect syntax near the keyword 'AND'. this is the line....... strSql = strSql & "AND customer = '" & Session("Account") & "'" could anyone help me out with this ............?
0
7270
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7397
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7565
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7128
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5704
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5103
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
1612
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
817
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
473
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.