Posts Under ''

how to find carriage return in string using java

Just like you would identify any other character in a string: look for “\r\n” or “\n” (system dependent).

Read more »


in struts

errors.header=<UL>errors.footer=</UL> errors.prefix=<LI>errors.suffix=</LI> The default code for queuing an error message is: errors.add(ActionErrors.GLOBAL_ERROR,new ActionError("error.username.required")); To specify that this message is for the "username" property, we would code this instead: errors.add("username", new ActionError("error.username.required")); <html:errors property="name_of_the_field"/>

Read more »


Working with JSP Sessions

* getCreationTime —returns value of time in milliseconds. * getLastAccessedTime—returns the value of time in milliseconds. * getId—method of session object is used to return the unique identifier associated with the session. * invalidate() * getMaxInactiveInterval * setMaxInactiveInterval() * removeAttribute(String name) * setAttribute(String, object)

Read more »


Checking the results of a ResultSet

boolean recordsWereFound = false;while (rs.next()) {recordsWereFound = true;// process this record;}if (! recordsWereFound) {// do this if no records were found}

Read more »


forward from one application to other application

The number of ways in which we can forward from one application to another application running on different containers.I think these 2 can work :1.ServletContext.getRequestDispatcher.forward(“URL of the 2nd application”)2.response.sendRedirect(“URL”)

Read more »