Get url parameters without splitting [duplicate] - java

This question already has answers here:
How can I get query string values in JavaScript?
(73 answers)
Closed 9 years ago.
Is there somebody who can get the Parameters from the a href class="popper" without manipulating them (in javascript)
<a href="./myservlet?AfspraakID=${cell.afspraakId}&Id=${cell.id}&KlantId=${cell.klant.id}" class="popper"</a>
The result i need is:
AfspraakID=${cell.afspraakId}&Id=${cell.id}&KlantId=${cell.klant.id}
I don't think it is that hard, but i cant find my solution(can you pls call the a href class to get the parameters from it)
thank you so much

$("a.popper").prop("href").split("?")[1]

Related

How to make an XPath which contains both starts-with and not end-with attribute? [duplicate]

This question already has answers here:
How to write an XPath query to match two attributes?
(4 answers)
Closed 11 months ago.
I need to make an XPath.
I am writing a script and trying to get an exact element from the page.
Selenium supports xpath-1.0
Where as ends-with() isn't part of xpath v1.0 but a part of xpath v2.0 specifications.
Hence, you can't use the ends-with() clause directly.

Is there a way to print a Java model in InteliJ prompt? [duplicate]

This question already has answers here:
How do I print my Java object without getting "SomeType#2f92e0f4"?
(13 answers)
Closed 1 year ago.
When I sysout the RestModel in Java code, it's printed out like this.
[com.my.model.RestModel#14ab40d2]
Is there a way to display the Detail? (like Json?)
You can override your model's toString() method and have it print out the information you want in the format you want.

How to get substring from URL? [duplicate]

This question already has answers here:
How do I decompose a URL into its component parts in Java?
(5 answers)
In java, what's the best way to read a url and split it into its parts?
(5 answers)
Closed 3 years ago.
I have couple of URL's like
http://toidsu.abc.tnd:9083/login/pages/selection.xhtml#
http://toifsmdu.abc.tnd:9081/login/pages/selection.xhtml#
I want to get string up to 'http://toidsu.abc.tnd:9083' and 'http://toifsmdu.abc.tnd:9081'
How to do it?
Use this class to parse it for you: java.net.URI

Java get xml elements value using xpath "And" [duplicate]

This question already has answers here:
XPath with multiple conditions
(5 answers)
Closed 9 years ago.
My question is as follows:
I'm using xpath to get the values i need in the XML.
How do i get a value that has 2 conditions?
e.g. BOOK[UIM_LEVEL_TYPE='AAA'] and [UIM_SUB_REC_TYPE='BBB']- doesn't work..
Whats the the correct way to write it?
What's wrong with BOOK[UIM_LEVEL_TYPE='AAA' and UIM_SUB_REC_TYPE='BBB']? Or, for that matter, BOOK[UIM_LEVEL_TYPE='AAA'][UIM_SUB_REC_TYPE='BBB']

hi I want the code for &b=52&f=norefer and &b=52 [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
I want the pattern for removing the &b=128&f=norefer from following url
http://www.yahoo.com/url/5f&b=52&f=norefer
http://www.yahoo.com/url/6aa82d?show=all&page=2&b=52
String finalUrl =decodedUrl.replace("&b=52","");
page.setPageUrl(finalUrl);
I want to remove &b=52&f=norefer from the first url and &b=52 and from the second url which pattern i will use please give me the code without hard-coded value.
url.replaceFirst("&b=.*", ""); will remove the tail of the string starting from "&b=". I hope it is good enough for you. At least it is OK for your two exampels and is not sensitive to value of parameter b.
If it is not enough try to describe your task more specifically or just learn a little bit regular expressions.

Categories