i have one jsp page. inside this,
String s=req.getParameter("raja");......
now we want to remove duplicate characters and o/p will be
like "rj".... what is the logic?
Answer / sajin dhas
Please check below jsp code.
<% String message= "saajin";
for (int i = 0; i < message.length(); i++){
for (int j = i + 1; j < message.length(); j++){
if (message.charAt(i) == message.charAt(j)){
message = message.substring(0,(j - 1)) +
message.substring(j + 1, message.length());
out.println("Servlet Communicate Messge\n"+message);
}
}
}
%>
Is This Answer Correct ? | 0 Yes | 0 No |
What are stored procedures? How is it useful?
Can constructor be used instead of init(), to initialize servlet?
How does a jsp engine work?
Differentiate between include directive and include action.
Can we override the jspinit(), _jspservice() and jspdestroy() methods?
Why use of scripting elements in jsp is discouraged?
Are dialogue tags necessary?
Differentiate between <jsp:include page=…> and <%@include file=…>.
What is the use of jstl tags in jsp?
Explain client and server side validation?
What are actions and directives in jsp?
Explain the jsp life cycle?