Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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?



i have one jsp page. inside this, String s=req.getParameter("raja");...... now we want ..

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

Post New Answer

More JSP Interview Questions

What is the page directive is used to prevent a jsp page from automatically creating a session?

0 Answers  


Is it possible to share an httpsession between a jsp and ejb? What happens when I change a value in the httpsession from inside an ejb?

0 Answers  


What is auto-flush attribute?

0 Answers  


How can we disable el?

0 Answers  


what is the difference between jsp and servlets ?

0 Answers   Cap Gemini,


What is jsp and its uses?

0 Answers  


Java Server Page I can use a function in two ways: Either I declare <jsp:useBean id="myBean" scope="session" class="mypack.mysubpack.MyClass" /> or I declare <%@ page import = "mypack.mysubpack.MyClass" %> In each case I can call a function later by coding MyClass.myFunction(); So what is the difference between the two variantes? Why are Beans invented if we don't need them because we have the import statement ? please guide me its an humble request to you reader if u know n i'll be thankful to you...........

0 Answers  


what is difference between the contart and implementation?

0 Answers   iFlex,


i am using rich faces datatable rich:datatable. On entering the value, values get filtered in table. Now how can i get the value in back9ing bean..?

1 Answers  


how to maintain sessions in jsp?can you tellme the methods.

16 Answers   IBM, Scope International, TCS,


How can we disable java code or scripting in jsp page?

0 Answers  


How does error handling occur with jstl?

0 Answers  


Categories