[Solved] Hiding URLs from the location bar

You can use the javascript history.pushState() here history.pushState({},”Some title here”,”/”) For example, on http://yourwebsite.com/secretlink.html, after the JS runs, the URL bar will show http://yourwebsite.com/ without having refreshed the page1. Note that if the user refreshes the page they will be taken to http://yourwebsite.com/ and not back to the secret link. You can also do something … Read more

[Solved] how to display values in jsp through java class [closed]

i think you should try this public class EmpBean { public java.util.List dataList(){ ArrayList list=new ArrayList(); try{ Class.forName(“driver”); Connection con = DriverManager.getConnection(“url”, “user”, “pwd”); Statement st=con.createStatement(); System.out.println(“hiiiii”); ResultSet rs=st.executeQuery(“select * from employee”); while(rs.next()){ list.add(rs.getString(“name”)); list.add(rs.getString(“address”)); list.add(rs.getString(“contactNo”)); list.add(rs.getString(“email”)); } System.out.println(rs.getString(“contactNo”)); } catch(Exception e){} return list; } } Assuming this class working fine and it is returning … Read more

[Solved] in HTML page can we use jsp code

Any server-side code would need to be executed on the server, not in the browser. There’s a hard separation between the server-side processing and the client-side processing. So the JSP code wouldn’t be able to interact with the JavaScript code or anything like that. In order for server-side code to be executed in an HTML … Read more

[Solved] Send value from 1 jsp to another jsp

Getting value from the request, you should be putting a value to a request. This code request.getAttribute(“testvalue”); is getting a value, but that code request.setAttribute(“testvalue”, value); is putting it. This is because you want to avoid using the HTTP session. solved Send value from 1 jsp to another jsp

[Solved] Can we add muliple document.ready functions in a jsp page with unique API calls inside them?

Yes you can have multiple callback function on document.ready like this $( document ).ready(function() { console.log( “ready!” ); }); $( document ).ready(function() { console.log( “log!” ); }); $( document ).ready(function() { console.log( “status!” ); }); this have nothing to do with your api response but you can not have multiple callback function on window.onload like … Read more

[Solved] IE8/Firefox Behavioral Difference

Since the lost focus seems to happen every 6000 milliseconds, I’d point the blame somewhere at expandone()/contractall() in /js/qm_scripts.js. Your login form is in the “dropmsg0” div, causing it to be briefly hidden and redisplayed every 6 seconds. The textboxes lose focus in IE8 when hidden. I’d either rename the div to exclude if from … Read more

[Solved] Calendar order in java [closed]

use TreeSet, by implementing Comparator interface and providing reverse sorting logic and finally add all elements of HashSet to TreeSet using addAll() method of Collection interface. // using Comparator constructor argument of TreeSet TreeSet < String > ts = new TreeSet < String > (new Comparator < String > () { @Override public int compare(String … Read more

[Solved] Want to Generate Auto Login Program Using Java

You can do this with the help of selenium.setup selenium in your eclipse first. below is the code for login.similarly you can write program for your profile from. public void login(){ SeleniumUtils.setTextFieldValue(“input#username”, “userName”); SeleniumUtils.setTextFieldValue(“input#password”, “password”); SeleniumUtils.clickOnElement(“div#btnLogin”); } public static void setTextFieldValue(String cssSelector, String value) { WebDriver driver = new FirefoxDriver(); WebElement field =driver.findElement(By.cssSelector(cssSelector)); field.sendKeys(value); } … Read more

[Solved] compare HashMap and ArrayList java

You can compare like below Code: List<String> global = new ArrayList<String>; Map<String, ArrayList<String>> newMap = new HashMap<String, ArrayList<String>>(); Map<String, ArrayList<String>> map = new HashMap<String, ArrayList<String>>(); for (String key:map.keySet()) { List<String> arrayList= map.get(key); for (String words:arrayList) { List<String> newList = new ArrayList<String>; for (String globallist:global) { if(words.equals(globallist)){ newList.add(words); } } newMap.put(key,newList); } } 1 solved compare … Read more

[Solved] Connection of JSP with MySQL failed

Ok Here the Solution to connect MYSQL with JSP above given program. I asked about to my boss, he is a real expert… First open Netbeans Click on SERVICES then Right Click on the server like for me its “Apache Tomcat” then select Edit Server.XML Add below Line at line 39 i think between GlobalNamingResources … Read more

[Solved] Why isn’t this JSP – Servlet code work?

A NullPointerException, most of the time, means that you’re dereferencing a null variable. I assume the line causing the exception (line 97 in z.java, as the stack trace indicates) is the following line: yy.getXs().add(s); Then it can mean two things: yy is null The list returned by yy.getXs() is null. Use a debugger to identify … Read more