40 questions
0
votes
1
answer
82
views
Replace variable amount of characters in JSTL match
I have a text string with 0-5 leading spaces at the beginning of lines that is being displayed in a JSP, and it needs to keep those spaces for indentation
The way the code is currently, it's hard-...
-1
votes
1
answer
54
views
How I can split the string based on "--" only in jsp
When I am trying to split the string based on "--"(double hyphen) its also splitting the string contain "-" (single hyphen)
**tempMessage="hello--Name:xyz";(its splitting ...
1
vote
1
answer
347
views
How to iterate through JSON Array or JSON object in JSP using JSTL
I'm having this json:
{
"maxAgentAmt": 66,
"minComAmt": 3,
"maxTxn": 7,
"maxAmt": 99,
"minAmt": 3,
"maxComAmt": 99
}
and I also have to get ...
0
votes
0
answers
23
views
Uncaught SyntaxError: Invalid Unicode escape sequence \u [duplicate]
I have a JSP which is used to display location in UI form where JSTL code is been used,
function setLocation() {
var fullPath = "${fn:escapeXml(folderPath)}";
updateFolderPath(...
1
vote
1
answer
257
views
How to write a generic JSP Template for Dropdowns etc.?
I want to create JSP templates, i. e. JSP files that contain e.g. a dropdown or input field, to keep the styling of the elements in one place.
Now these templates should be used in different UseCases. ...
0
votes
1
answer
105
views
Right way to write a JSTL expression plus a string
Hy guys, I apologize if this is a stupid question, but I couldn't find any examples on how to do this.
My expression is currently ${fn:substringBefore(var1, \"@\")}@domain.com.
I've been ...
1
vote
0
answers
249
views
How can i change the value of param 'items'<c:forEach var="entity" items="${p:someSortByTime(someEntities)}">to replace the way of sorting
I have such snippet of code, I would like to change the way of sorting (now is sortByTime) but for instance i want to change for sortByTitle or sortById how can i do this?
Exist class with my methods ...
0
votes
1
answer
3k
views
Unable to import taglibs using JSTL on Java 11 Spring Boot project
First of all I would like to say I found threads on SO talking about this problem (even 2020 comments) and none of them helped me fix this problem.
I am migrating project from java 8 (Oracle SDK) to ...
0
votes
1
answer
982
views
JSTL fmt:formatDate with locale dependent pattern [duplicate]
In a JSP page I have to display some dates, but none of the available date formats (short, medium or long) suits me.
<fmt:formatDate value="${someDate}" type="date" dateStyle="short"/>
<fmt:...
0
votes
0
answers
233
views
How to pass a param tag dynamically to JSTL query?
I'm using the JSTL query tag to do the mysql query as following:
<sql:query var="altTime" dataSource="${dataSource}" scope="request">
SELECT distinct combined.alt_tm FROM (
...
0
votes
0
answers
30
views
Why JSTL(1.0) functions taglib do not work in jsp [duplicate]
Functions taglib is not working for jstl comparison.
uri : <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
i have included the jstl.jar in my lib folder and in order to ...
0
votes
1
answer
75
views
Replacing a word with trademark in JSP
I am displaying data from my oracle database onto my JSP page. Requirement is to locate “PEFC” text, remove PEFC and replace with: PEFC™
I am able to replace the word in JSTL but don't know how to ...
0
votes
0
answers
113
views
How to iterate in a foreach in jsp using JSTL
I have a hashmap: HashMap<String, array<strings>> Map = new Hashmap<>() ;
Its keys and entries are filled as following.
University,
I want to iterate over the map in a JSP. Get the ...
1
vote
0
answers
648
views
JSP page with if else conditions
I have a jsp form page where created a dropdown field. Based on one of the value chosen I need to show the upload button option which is in different jsp. I tried the below code. Can someone please ...
2
votes
1
answer
2k
views
getting value from an object in jstl, getting property name from a list
I am new to JSTL, I understand that to get field value we can use the following code:
<c:out value="${empDetails.id}" />
<c:out value="${empDetails.name}" />
<c:out value="${empDetails....
0
votes
1
answer
82
views
using dateParam for JSTL query
I'm trying to get a simple query returned on a JSP with very limited data, say about 20-25 rows max being returned.
I am somewhat new to using JSTL but I was wondering in the JSP with the tags, does ...
0
votes
1
answer
55
views
Special Chars like  not escaping from JSTL while triggering Email
I know this might have asked 1000 times, but I dont see a proper answer to this issue. I am trying to email a list of products in my IBM wbsphere commerce application.
I am not able to escape the ...
0
votes
1
answer
258
views
jstl c:set is not working on js code in jsp file
I have a JSON from a service. I am appending a html block by JSON value and I have to check some values for appropriate display.
I am trying to set discountValue variable but it not working with js ...
0
votes
0
answers
1k
views
JSTL tag replacement for bean:define
I am unable to find replacement for bean:define tag in JSTL.
<bean:define id="arraySize" value="<%=String.valueOf(abc.size())%>" scope="request" />
and
<bean:define id="abc" name="...
0
votes
0
answers
221
views
How to handle xss attack on search input field in jsp?
How to add c:out for input search box ?
<input type="text" name="search" id="search" />
Now if the user enters some invalid string(">) in the text box, the html renders it and impacting the UI ...
0
votes
1
answer
206
views
How to read form parameter data using JSP without using scriptlet
I want to read the form parameter data using scriptlet in #jsp. But i do not want to use any java code in JSP. Then do i need Expression Language or #JSTL or what?
-2
votes
1
answer
1k
views
Passing single and double quotes both in JavaScript function parameter from jstl (much tricky)
I know this looks silly to ask, but I got a situation where I have to pass parameters to a javascript function, and these parameters are of String type.
The issue with data is, the data can have ...
0
votes
0
answers
205
views
JSTL in dynamic table creation
I am new to Spring framework. I want to build a form where user needs to choose some values from select list. I have write down the code in body part of jsp page. This works fine.
<select id="...
2
votes
2
answers
2k
views
jstl functions not rendering in spring boot web application when war deployed in tomcat
when spring boot web application deployed in tomcat jstl functions not rendering.kindly help me on this issue.
what changes should be done while deploying war in tomcat
Added dependency:
<...
0
votes
1
answer
51
views
Try to do something similar to @Adjust in jsp
I am trying to determine whether the date is within 60 days (compare to today's date).
If the service date is within 60 days, the column will show "Yes", on the other hand, if the date is over 60 ...
2
votes
2
answers
749
views
JSTL timezone (KST) implementation error found
While I practicing JSTL timeZone tag, I tried to run these two actions:
<c:set var="now" value="<%= new java.util.Date() %>" />
<fmt:timeZone value="GMT+9:00">
<fmt:...
0
votes
1
answer
633
views
JSTL - add parameters to call [duplicate]
I have the following code in JSTL that retrieve student picture in j2ee site
<c:if test="${student.studentPictureId != null}">
<a href="javascript:showImage('<c:out value="${...
2
votes
0
answers
125
views
JSTL function escapeXml (List<SelectOption>)
<div class="width-20">
<div class="inputBlock clear">
<label>Select a month:
<form:select id="monthSelected" path="month"
items="${form....
1
vote
1
answer
2k
views
How to split a string from another string in JSTL
I am new to JSTL and figuring out a way to split a string using another string. For example supppose my string is
s= "Hello! Good Morning",
and the
t = "Good ",
then I should have str[0] = 'Hello!...
0
votes
0
answers
484
views
Using JSTL enable/disable button based on text entry in text area
I am new to JSTL, I know it's quite straight forward in JavaScript/jQuery but wanted to know how I will be able to achieve the result using JSTL on a JSP page.
Actually I have a form with a text ...
0
votes
1
answer
174
views
Check multiple list sizes in JSTL
How do I chain multple length checks?
I tried these ways to no effect:
<c:if test="${fn:length(app.applicationAdminComments) le 0 or fn:length(app.applicationChoComments) le 0 }">
and
<...
0
votes
1
answer
2k
views
JSP String to Long exception
I have a code in JSP as follows
<td class=odd
style="text-align: center"
height=30><c:if
test="${mMap['GENERAL'].errorFac != 0 and not empty mMap['GENERAL'].errorFac}">
&...
0
votes
1
answer
896
views
How can i iterate list inside an object in spring JSTL
I need to iterate a list inside an object. Am attaching image which contains how the object is coming on debug mode. Here is my code.
JSP:
<div class="sample">
<c:forEach items="${...
0
votes
1
answer
128
views
How to print random value next to original value using jstl?
I am using JSTL to push the CSS in HTML pages
like if CSS name is abc.css I want to append timestamp next to CSS due to caching issue abc.css?time=21223233232 using JSTL
<c:forEach var="css" items=...
0
votes
1
answer
202
views
JSTL solution for providing space between capital letters [duplicate]
Is there any way to provide space between Capital Letters.
Eg. I have a jstl expression ${platName} which outputs AmazonEcho
What I need as output is Amazon Echo.
I tried a few jstl functions but ...
0
votes
0
answers
39
views
using of if else conditions inside for loop to change buttons(color) inside the jstl tags [duplicate]
I have a serious question folks! I am trying to develop a JSP view and I am using 1) for and 2) if/else conditions, to change the colors of the buttons accordingly to green(if even i.e., if(i%2==0)) ...
1
vote
0
answers
284
views
set dynamic variable name in jstl while using MAP
I need to set the dynamic value for the var in jstl,
My code is
<c:forEach var="entry" items="${mapData}">
<c:set var="row${entry.key}" value="${entry....
0
votes
0
answers
21
views
how to combine iteration value in foreach loop to a getmethod name [duplicate]
enter image description here
Here, I am trying to print 10 labels using getter methods there are 10 getter methods in my bean class named as getLabel1(),getLabel2().......getLabel10().
instead of ...
-1
votes
1
answer
204
views
JSTL Split method not working properly?
I'm trying to split a string using JSTL method and splitting it on the basis of four quotes ''''. Below are the details:
example = ''''THE FAMOUS DIAMONDS''''This is second string for the example''''/...
0
votes
2
answers
378
views
Why can't we use JSTL fn tags independently, just like core tags
If functions tag library are also part of JSTL then why can't (or don't) we use them like other tags? For example, with core we can say something like this?
<c:if test="1==1">
<h3>...