Ampersands in query strings
Hi,
I was wondering if anyone has attempted to parse query strings that contain ampersands (&) or equals (=) in the parameter values.
At the moment we have some working code to do this but it is kind of messy and complicated. If possible we would like to make use of Java classes to do this for us. I was thinking along the lines of using some or all of:
Hashtable javax.servlet.http.HttpUtils.parseQueryString( String s)
String java.net.URLDecoder.decode( String s)
String java.net.URLEncoder.encode( String s)Has anyone managed to implement a parser using these classes? Basically the problem is determining where to split the name/value pairs when the delimiters may be included in the values.
Just to give you an idea, try parsing the following URL
http://someserver/servlet?parm1=val&ue&parm2=val=ue
Craig
Here's the thing:
If submitting by form then req.getParameter(name) works fine for both types of parameter values.
If submitting by link then req.getParameter(name)
- Works for parameters with '=' in them
- Doesn't work for values with '&' in them.
I actually need to be able to parse a query string (the parameter list part of a link). However, it isn't specific to submission processing.
I want to be able to parse the string generically regardless of whether it comes from the web or whether I call it from within the code.
In short, I want to be able to take a string like Param1=Val&ue&Param2=Val=ue and split it into name/value pairs from anywhere in the code.
Similar Messages
-
Query string filter webpart ampersand issue
Hi
I need to send the query string to infopath form, so for this i am using Query String Filter webpart. It works great but when there is ampersand (&) in the querystring, it does not read after ampersand value.
Ex - I am having the URL
http://sharepointsitecollectionURL/Pages/Default.aspx?Parameterval=One
& two
So in above it reads parameter value is "one" and ignore "two"
I know that if i replace the ampersand in querystring with %26, it will read "one & two". But some other system is hitting this URL and i cannot modify the URL in that system.
Please let me know if anyone knows the solution
ThanksI think & won't work in the query string filter webpart.
Please check this
http://mysharepointwork.blogspot.in/2011/05/query-stringurl-filter-web-part-with.html
http://stackoverflow.com/questions/2681997/moss-filter-webpart-not-working-with-symbol-in-the-query-string
http://bighow.net/3800725-MOSS_Filter_webpart_not_working_with__amp__symbol_in_the_query_string.html -
CiscoIPPhoneExecute with URL query strings
Has anyone successfully used the CiscoIPPhoneExecute xml object with URLs that contain query strings? Specifically, I'm wondering how to pass query string values that include spaces.
I'm able to successfully execute a URL such as:
http://<webaddress>/PushPage.asp?Field1=Value1&Field2=Value2
However, when I try to execute a URL like:
http://<webaddress>/PushPage.asp?Field1=Value with space&Field2=Value2
The phone displays an error message that says "Not Available", and the url that is pushed never gets executed.
I have tried representing spaces in the query string values using both the conventional "+" symbol, and I have also tried using "%20". Neither of these escape sequences seems to work.
Thanks for any advice.
-MikeThanks for the response. As I stated above, I know that ampersand (&) must be escaped, and I am properly escaping that character in the XML packets. I'm not having any problems pushing URLs that contain ampersand.
What I can't figure out is how to push URLs with *SPACES* included in the query string values. Please see the example URLs I posted in my original message, specifically the second URL. Again, I omitted the necessary ampersand escape sequence there for clarity.
-Mike -
QSUF (Query string url filter) and SQL Server reporting services report viewer parameters
Hi,
this is my issue:
I have a SQL Server reporting services web part on a page with a report with 1 parameter, lets say it's a client list
Then i have a QSUF that will be used to filter the clients list through the URL
However, once i connect the filter and the report viewer web part, the parameter goes away and is no longer accessible
I'd like to somehow keep the parameter visible, in case there is no parameter sent through the URL, i would like the user to be able to choose a client from the parameter drop down list
I saw that there is a "send empty if no values are passed" option, but i can't seem to get this working properly and i don't know if this option will make the parameter visible again
Any help would be appreciated
Thanks.Hi,
According to your post, my understanding is that the query string url filter web part not worked well with SQL server reproting services web part.
Did you use the Wiki page layout in your environment?
You can change the page to a web part page, then check whether it work.
There is a similar thread for your reference.
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/4d7584e3-8e1a-48bf-9346-32f8cb480dd1/query-string-url-filter-web-part?forum=sharepointgeneralprevious
Thanks & Regards,
Jason
Jason Guo
TechNet Community Support -
Getting extracter 'N' in query string from weblogic server
hai,
I am using weblogic7.0 as app server and mssql2000 as database server.
When writing sql queries i am using prepared statements.
Ex:
PreparedStatement pstmt=con.preparedStatement("select email from temp where tempid=?")
pstmt.setString(1,"0000A");
after executing the above query. If i check the query statement in database profiler
then i am getting the following stament:
select email from temp where tempid=N'0000A';
here i am getting an extra character 'N' in the query string.
Can anybody tell me how can i avoid that.
Thanks in advance
--durgadurga wrote:
hai,
I am using weblogic7.0 as app server and mssql2000 as database server.
When writing sql queries i am using prepared statements.
Ex:
PreparedStatement pstmt=con.preparedStatement("select email from temp where tempid=?")
pstmt.setString(1,"0000A");
after executing the above query. If i check the query statement in database profiler
then i am getting the following stament:
select email from temp where tempid=N'0000A';
here i am getting an extra character 'N' in the query string.
Can anybody tell me how can i avoid that.
Thanks in advance
--durgaHi. The driver is putting that there to ensure that if your parameter is a
true-16-bit character that the DBMS doesn't corrupt it.
If your string data are guaranteed to be simple English 7-bit ASCII
characters, there's a driver property you can add to the pool connection
properties that will tell the driver not to put the "N'" prefix. This is
an important performance benefit because the "N'" will stop the DBMS from
using varchar indexes in searches.
If you are using the weblogic mssqlserver driver, add the useVarChars=true
property. If you are using the MS free driver or the DataDirect driver,
add a property sendStringParametersAsUnicode=false.
Joe -
How do I add a record's primary key to a query string and add that to an .xml catalog?
Hello everyone,
I am using Dreamweaver CS3 on a MacBook Pro Leopard 10.5.6 and MAMP 1.7. I am also teaching myself how to work with PHP and MySQL, using David Powers book The Essential Guide to Dreamweaver CS3.
I am trying to create a wedding photography web site, with a personal page after login, which will display the photographs of the customers wedding.
The same page will also be a catalog/shopping cart, so the customer can choose which photo's they want, and pay for them. (I am aware that there are instructions in The Essential Guide in chapter 15 page 515, on how to redirect to a personal page, but it doesn't fully cover what I am asking).
I have already created the login success page, which greets users by name, as per the instructions in The Essential Guide. I have also created a catalog page. However my catalog page is not calling information from the database, instead it is taking information from an XML page using PHP.
I would like to insert a list menu on the login success page, which lists the customers name, and when they select their name they will then select a link that will take them to a personal page with just their wedding photographs.
I am unsure of how to pass the customer_id, in what will be the username list menu, to the page which will contain the customers set of wedding images.
Is it the same process used in chapter 14 where you add a record's primary key to a query string?
I am asking because when I set up a recordset from the MySQL database it lists the images as witten names not actual images, I have tried calling the images with PHP code but it just doesn't work.
The catalog page I have set up at the moment is not calling the images from the database, but directly from the image folder.
Is what I am trying to do possible?
If so how do I pass the customer_id and username to a recordset and link that recordset to the xml catalog so the customers personal wedding images are displayed on the catalog page for the shopping cart? I need step by step instructions, or maybe a link to a good tutorial.
Can somebody help me please?
Thankyou.QuickTime 7 can set the poster frame, but I've not had much success with it. This is what QuickTime 7 Help says about this topic:
+A "poster frame" is a still image of a movie that represents the movie in places like the Finder. The default poster frame is the first frame in the movie. You can change the poster frame.+
+To change a movie's poster frame:+
+In QuickTime Player 7, drag the playhead (or use the arrow keys to move the playhead) to the desired frame.+
+Choose View > Set Poster Frame.+
+To view a movie's poster frame, choose View > "Go to Poster Frame."+
If you don't have QuickTime 7 (version 7.6.6) it can be installed from your Snow Leopard disc using a custom install. Otherwise download it from this Apple site: http://support.apple.com/kb/DL923
John -
SharePoint 2013 List View with query string filter stops working after editing view from browser
I have created one list definition in which I have added one list view which will filter data from query string paramater
So when I am creating list from my list definition, view with query string filter is working fine.
But when I am modifying view from UI(I am not changing any thing , just opening "Modify View" page and then click on "Save" button), view gets stop working means it's not filtering data based on query string
Any suggestion what I am missing?
Below is my list view schema
<View BaseViewID="11" Type="HTML" TabularView="FALSE" WebPartZoneID="Main" DisplayName="$Resources:OIPLBScoreCard,viewFilterTasksByTarget;" MobileView="True" MobileDefaultView="False" Url="FilteredTasks.aspx" SetupPath="pages\viewpage.aspx" DefaultView="FALSE" ImageUrl="/_layouts/15/images/issuelst.png?rev=23">
<Toolbar Type="Standard" />
<ParameterBindings>
<ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
<ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
<ParameterBinding Name="TargetId" Location="QueryString(TargetId)" />
</ParameterBindings>
<JSLink>hierarchytaskslist.js</JSLink>
<XslLink Default="TRUE">main.xsl</XslLink>
<JSLink>clienttemplates.js</JSLink>
<RowLimit Paged="TRUE">100</RowLimit>
<ViewFields>
<FieldRef Name="Body"></FieldRef>
<FieldRef Name="Title"></FieldRef>
<FieldRef Name="StartDate"></FieldRef>
<FieldRef Name="DueDate"></FieldRef>
</ViewFields>
<ViewData>
<FieldRef Name="PercentComplete" Type="StrikeThroughPercentComplete"></FieldRef>
<FieldRef Name="DueDate" Type="TimelineDueDate"></FieldRef>
</ViewData>
<Query>
<Where>
<Eq>
<FieldRef Name="oipscTargetLookup" LookupId="TRUE"/>
<Value Type="Lookup">{TargetId}</Value>
</Eq>
</Where>
</Query>
</View>
I have one lookup field from "Target List" in my source list and I want to filter data based on that lookup field.Hi JayJT,
The Miscellaneous is located in the contact list that you used for the connection.
So , you need to edit the page, then edit the contact list that you used, in the web part properties of the contact list, you will find Miscellaneous, then expand it and select ‘Server Render’ .
I hope this helps.
Thanks,
Wendy
Wendy Li
TechNet Community Support -
How to get the original query string in an event receiver when dialogs are enabled
I have scenario where I am adding a document to a document library which has an external data column on it. My goal for this column is to have it automatically populated with an appropriate value based on original query string to the page. The general
idea is that I am on a custom page that has various webparts on it including a view of my document library that is context sensative based on the query string, and I want to use that context sensitivity not just to filter the list but also when adding documents.
I have been searching around for solutions to this problem all day and have gotten this far:
I have an event receiver attached to my document library that handles the ItemAdded event syncronously (as such I have the new list item available to me). In that event receiver I am able to set the column values as required. Where I am stuck is on getting
the value from the query string that I need to actually set as the column value.
Based on:
http://social.technet.microsoft.com/Forums/en-US/sharepoint2010programming/thread/8cfcb299-9a55-4139-86ec-0b53b2922a54 and several similar articles/posts I have been able to get the original source Url with the query string I want via the following
code in my event receiver:
private HttpContext context;
public EventReceiver1()
context = HttpContext.Current;
public override void ItemAdded(SPItemEventProperties properties)
var originalQueryString = context.Request.QueryString["Source"];
// Parse the query string and use the value ...
The problem is that this solution breaks down if the dialogs are turned on under the advanced settings for the list. The reason the solution fails is because the "Source" query string parameter goes away and is replaced by "IsDlg" set to a value of "1".
Does anyone know how to get past this hurdle? Any help would be greatly appreciated.Hi Stuart,
The reason I'm looking for "Source" in the query string is because that is something I found to be reliable when the Dialogs are turned off. I've dug around pretty deep in the Request object to see if anything had the data I was looking for and unfortunately
it doesn't appear to be there. The
context.Request.QUeryString.ToString()
returns a rather simple one of:
List=%7b43ECDCB0-8440-4652-B067-AA20481779D7%7d&RootFolder=&IsDlg=1
and the
context.Request.UrlReferrer.Query.ToString()
has the same value.
I suspect this is due to the dual step process that takes place in adding an item to a document library where the first modal popup (which I suspect likely has the information I need) gives you the opportunity to browse to your file and then the second
dialog (maybe this is getting brought up as a result of another request which is now referring back to the original request that brought up the first dialog?) where you edit your properties.
Thanks for the try though, if you've got anything else I'd love to hear it. -
Can a single quote be used at the beginning of a query string parameter
Hi all,
I am a relative newbie and have a newbie question.
Can a single quote be used at the beginning of a query string parameter passed to a jsp page? Are there any inherant problems with this? Is there a comprehensive list of characters that must be escaped in a query string parameter?
Example: http://mysite.com/myjsp.jsp?param1='nghdh
ThanksYou'll have to escape most non-letter characters before you can pass them as a URL. I don't know if it's necessary for a single quote, but better safe than sorry.
Either use java.net.URLEncoder(...) or use javax.servlet.http.HttpServletResponse.encodeURL(String). I wouldn't recommend using unescaped characters in your URLs, that might cause pretty funny behavior that's sometimes hard to trace back. Don't worry about decoding it, your JSP/Servlet container will do it when you call javax.servlet.http.HttpServletRequest.getParameter(String). -
Dynamic Interface in Query String does not work?
Hi All,
i have exposed a interface as a webservice with the help of the Define Web Service in Configuration Builder.
In the SOAP Sender Communication Channel i have checked the options Use Encoded Headers and Use Query String
The url of the webservice looks like this:
http://server:50000/XISOAPAdapter/MessageServlet?channel=:BS:CC_SOAP_SENDER&version=3.0&Sender.Service=BS&Interface=http%3A%2F%2Fnamespace.com%2Fabc%2HER%2FGlobal%5EMIOS_GetDetails
This works which is great, i can now retrieve supplier details with this webservice. Now i want to expose another interface as a webservice. That URL looks like this:
http://server:50000/XISOAPAdapter/MessageServlet?channel=:BS:CC_SOAP_SENDER&version=3.0&Sender.Service=BS&Interface=http%3A%2F%2Fnamespace.com%2Fabc%2HER%2FGlobal%5EMIOS_EventBooking
As you can see i have a different interface in the URL's of the Webservices. I want to have both make use of the same Communication Channel which is possible according to [SAP Note 856597|https://websmp130.sap-ag.de/sap(bD1ubCZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=856597] See Q: Can I set the interface name dynamically from the client? also in this document : [How to Use the XI 3.0 Soap Adapter|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d23cbe11-0d01-0010-5287-873a22024f79]
The problem is that when i try to call the second web service (EventBooking) that is routes to the mapping of the GetDetails interface, i can see this in SXMB_MONI. Therefore it gives an Error.
When i try both scenarios in Configuration Builder they both work fine, only the webservice call of EventBooking ends up in the Message Mapping of GetDetail.... Why? And how to solve this?
Anyone have experience with the feature mentioned in the SAP note?After some further examination it seems that both calls are picked up by the same interface. In the RWB both the messages are picked up by the MIOS_GetDetails...
How can i fix this? -
How to look at a query string from Nav Bar Find Mode
I would like to view the resultant query string from the Navigavtion Bar's Find Mode. I am using a Master/Detail and am querying with the selection criteria from the detail only.
I am getting unexpected results, and would just like to SEE what the query string IS.
ThanksI am getting unexpected results, and would just like to SEE what the query string IS.Run your app with diagnostic output turned on. Here's the instructions for that.
To turn on diagnostic, go to the IDE,
1. Select the project.
2. Do right mouse click and select "Project Settings..."
3. On the Settings dialog, select Configurations/Runner.
4. In the righthand side pane, you should see a textbox for "Java
Options". Please add the following JVM switch:
-Djbo.debugoutput=console
Then, rerun. The run command should include
-Djbo.debugoutput=console as in
"D:\JDev9i\jdk\bin\javaw.exe" -Djbo.debugoutput=console -classpath ...
You should now see a lot more output on the IDE's message window.
This should also include the findmode query that gets built after you hit the execute button from a findmode panel. -
Need to customize the variable info sent to a query string
Hello,
I have run into a small issue while trying to send user data
selected from 1 DateField and 3 ComboBoxes in a form. Everything is
sending correctly except for the DateField, when sent is places
much un-needed info in the query string.
For example, this is what I need it to look like in the query
string:
https://reservations.ihotelier.com/onescreen.cfm?LanguageID=1&HotelID=13337&DateIn=09%2F28 %2F2006&Children=1&Adults=3&Length=3
Here is what is actually showing up right now:
https://reservations.ihotelier.com/onescreen.cfm?LanguageID=1&HotelID=13337&DateIn=Thu%20S ep%2028%2000%3A00%3A00%20GMT%2D0700%202006&Children=1&Adults=3&Length=3
You'll notice that everything is fine except for the DateIn
variable. So, I guess I'm asking if anyone knows how I can
customize the data that is sent to the query string, with specific
characters (example: I don't need "%20" in the DateIn, however I
need those to be "%2F"), as well as the name of the month to be
just the month number. I need to get rid of all the time
information in the DateIn variable. Please, any help would be
greatly appreciated! Thank you in advance! :)
Here is my action script right now:The functionality of the GIS map was important. I was given the email for the person in charge of the map, who helped me out. It appeared that he was able to outline the road in the neighborhood that I needed to focus on. That provided a parcel ID, which in turn made it possible to focus in on the proper area. This is supposition on my part; perhaps he has other info that gave him the parcel ID.
I'm not a huge fan of Flash on other than desktops and laptops, but it is what it is, client needs to use it, I need to help the client out!
B -
Hi,
I want to pass multiple query string values using the same parameter in Query String (URL) Filter Web Part like mentioned below:
http://server/pages/Default.aspx?Title=Arup&Title=Ratan
But it always return those items whose "Title" value is "Arup". It is not returned any items whose "Title" is "Ratan".
I have followed the
http://office.microsoft.com/en-us/sharepointserver/HA102509991033.aspx#1
Please suggest me.
Thanks | Arup
THanks! Arup R(MCTS)
SucCeSS DoEs NOT MatTer.Hi DH, sorry for not being clear.
It works when I create the connection from that web part that you want to be connected with the Query String Filter Web part. So let's say you created a web part page. Then you could connect a parameterized Excel Workbook to an Excel Web Access Web Part
(or a Performance Point Dashboard etc.) and you insert it into your page and add
a Query String Filter Web Part . Then you can connect them by editing the Query String Filter Web Part but also by editing the Excel Web Access Web Part. And only when I created from the latter it worked
with multiple values for one parameter. If you have any more questions let me know. See you, Ingo -
How to manage Locale info in the URL path, but not the query string
We are building an application using Struts 1.1 and Tiles, on Oracle Application Server 10.1.3.3...
I know this is a strange question... but we have a requirement to represent the locale info in the URL string using one of the following options:
option 1: /eng/page.do?id=2 for english.../fra/page.do?id=2
option 2: /page-eng.do?id=2 for english.... and /page-fra.do?id=2 for french
We need to represent the 3 letter ISO lang code either in the directory structure, or suffix the page name (in our case, the struts action name)... we cannot replicate this using a parameter in the query string. I know this is odd, but that is what we are told to implement.
Is there any robust way of implementing either option in Struts 1.1, JSP, JSTL etc...?
Currently, we are looking at using a servlet filter to intercept the HTTP requests, parse the URL string, and extract the ISO lang value, and set locale and forward on the request.
This poses a few problems... adding additional action mappings (page-eng... page-fra... page) to our struts-xml.config file to handle lang permuations... but the biggest issue is all the embedded html:link action values throughout our code...
Because all our public facing URLs must comply with the rule, we need to change the html:link action to point to a different action, based on locale.
Very inefficent, and I'm sure not industry standard best practice... we are using Tiles, and resource bundles for all our labels etc... but fall short in meeting this rule with regards to URLs and locale.
Any advice or tips etc.. is greatly appreciated.The filter option sounds like a good solution. So it can receive the urls and parse them appropriately.
You just need to take it one step further.
Additional actionmappings in your struts-config should not be necessary.
Filter:
- analyses the url and sets the appropriate locale
- adjusts the url such that the next level of the chain does not have to know anything about the locale being encoded in the url string.
Thus your struts classes and mappings can remain unchanged
/eng/page.do or /fra/page.do once through the filter should just look like /page.do to struts.
That should get rid of half of your headache.
Next the issue of generating urls.
There are two approaches I can see here
1 - use the filter approach again, this time with some post processing. Gather the generated HTML in a buffer, and do a find/replace on any urls generated, to put the locale encoding into them.
2 - Customise struts to produce urls in this format. This would involve the html:link tag, and the html:form tag at the least (maybe others?). Get the source code for struts, and grab the html:link tag code. Extend that class to generate urls as you want them to be generated. I think you would need to extend the class org.apache.struts.taglib.html.LinkTag and override the protected method calculateURL. You would then have to edit/modify the struts-html tld to point the link tag at your classes rather than the standard ones.
Option 1 is architecturally good because it gives you a well defined layer/border between having the locale encoded in the url, and not having it there. However it involves doing a find/replace on every html going out. This would catch all urls, whether generated by html:link tag or not.
Option 2 requires customising struts for your own requirements, which may be a bit daunting, but has the advantage of generating the urls correctly without the extra overhead involved with option 1. Of course you would have to ensure that ALL urls are generated with the html:link tag.
On reflection, I think option 1 is preferable, as both easier and quicker to implement, and doing a better separation in the architecture.
Cheers,
evnafets -
Hi,
I am filtering SharePoint list view web part based on Query string parameter and I am doing Export to Excel by using following code.
<a href="#" onclick="javascript:window.location='../_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List=0DC67399-BE11-48F3-ADFC-E911FB8B5845&View=54671412-3EFE-4281-835A-9EF747AE774E&CacheControl=1'"><img
alt="Excel" src="/_layouts/images/icxlsx.gif" border="0"/> Export to Excel</a>
Issue: Able to do Export to Excel when there are no filters applied on list view web part but if applied filters on web part and do export to excel , only header fields are displaying in the excel sheet.
I don't know why owssvr.dll is behaving like that .
Please share your ideas.
Thanks in Advance.Hi,
According to your post, my understanding is that you wanted to create hyperlink to export to excel.
The URL to execute the export is as follows:
{Site URL}/_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List={List GUID}&View={View GUID}&CacheControl=1
After getting the GUID, you need to “decode” the list GUID.
Replace %7B with {
Replace %2D with –
Replace %7D with }
More information:
Create Link to Export Library Contents to Excel
SharePoint - Create a link to export to Excel
Best Regards,
Linda Li
Linda Li
TechNet Community Support
Maybe you are looking for
-
When I connect my Ipod nano my automatic itunes account is using my old email address. This address does not exist anymore and even if it did I have forgotten the password. How am I able to update the idtunes account to be my current one and sync al
-
IBOT - can we put the Repository Variable in the filename
Hi, In an IBOT i use the Advanced - custom script option to export the extract to a server. instead of altering the javascript, i was hoping to add the timestamp to the filname by including a Repository dynamic variable in the 'Other Parameters' fiel
-
Hi, Im not sure if what I am thinking can be done, please bear with me... I have two Java program A and B (I would rather not change the source for B as its a proven app), program A instantiates B through using Runtime.exec(). However program B also
-
Pass through HTML in Tech Comm Suite
Hi Folks, I'm evaluating the Adobe Technical Communication Suite and would like to know if there is a way to pass through source HTML content when my Frame documents are added to a RH project by reference. I am generating Web Help (if that makes a di
-
My son try to enetr the password,and now my Ipod is disabled for 22,899,987 minuts,what do I do