jsp

Conditional column using JSP

Hello All, I recently started using the DisplayTag library and I've run into a problem. I'm trying to create a column that will allow the user to link to another page if that other page will actually have something to display. I have it setup so that there's always a hyperlink there but I'm having trouble with the conditional. I have a...

Simple JSP website

Hey There! I'm looking for help/advise with creating simple JSP website using equivalent of PHP include+switch function. The goal is that I want be able to switch between multiple JSP include pages in one main page. What will be simples possible form of above 'function'? Many thanks! ...

JSP download - application/octet-stream

I have a page in JSP that list some file that could be downloaded by a user. Thoses files are not on the local server, they are on a remote file server. When the user click to download a file, the webserver connect via TCP to the file server. The web server download the file and create a HTTP response for the client. Here is my code: ...

how to integrate jquery calendar with jsp

hello everyone.. i have a problem to load the event data from mysql to jquery fullcalendar..the example given is in php and i dont know how to do it java.. this is the sample code: $year = date('Y'); $month = date('m'); echo json_encode(array( array( 'id' => 111, 'title' => "Event1", 'start' => "$...

Validation of the request from a particular page

I have an application in which I need to validate that the request to the present page has come from a particular page. I need to display the page from which the request is supposed to come if the request has not come from that page. What could be the possible approaches? I was thinking of a encrypted value which could be present in both...

How can i run my test cases(which written in junit 3.x and 4.x) using jsp?

I want to run my all test cases which is written in both junit versions(3.x & 4.x) in JSP. if i called that jsp it should run all test cases. pls guide me. thanks for advance. ...

Enable checkbox B only when checkbox A is enabled and the other way around.

I have a two columns of checkboxes with predictable names. How can I disable a checkbox in column B when the ones in column a is unchecked and only enable it when the first the checkbox a is enabled? <dmf:checkbox name="someNameAColumnNumber" value="true" onclick = "enableColumnBCheckBox" runatclient="true" /> Is there somethi...

send email on exception or error

hi, I'd like to get an email when an error or exception happen in my web application, so that i can do the fix quickly.I've set a JSP error page. I like to show the error page to the client and at the same time get an email. I use jsp and a corresponding servlet and controller for each jsp. How can i call the servlet to send email whe...

Redirection from jsp:include page

I want the user to be redirected to Login.jsp if the "role" stored in Session Scope doesn't match with the Request Parameter "accessRole" HomePage.jsp <jsp:include page="Header.jsp"> <jsp:param value="d" name="accessRole" /> </jsp:include> Header.jsp <c:if test="${sessionScope.role!=param.accessRole}"> <c:redirect url="Login.jsp"/> ...

Does a RequestDispatcher forward maintain the original request's HTTP method?

I want to intercept a request using the RequestDispatcher, and then I want to forward the request along to another servlet -- something like this: RequestDispatcher dispatcher = request.getRequestDispatcher("/servlet/some.ThirdPartyServlet" + "?" + "param_name=" + "somevalue"); dispatcher.forward(request, response); If the incoming re...

UTF8 encoded XHTML content in JSP

Hi, I am trying to display XHTML content in a JSP page. The encoding is UTF8. The jsp page calls a method in a java class and the method returns the xhtml content. Basically this is what I have in my jsp page <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-...

Assigning values from JavaScript to Java variable

How to assign a value from JavaScript to Java variable in the JSP page? Is it possible to do this? The following is the javascript function: function loadGroupMembers(beanArrayVal){ document.getElementById("beanVal").value=beanArrayVal; ------------I have mentioned my requirement below -------------- %%%%%%%%%%%%%%% in...

Upload the image with preview

Hi I wanted to upload images(along with other form details) and preview them, using jsp and servlets. I am able to do the uploading part but could not get, how to preview the images in the frontend. I am using YUI to implement it. Actually I am trying to reuse an example which is implemented in PHP. I am attaching my Servlet code here....

Replacing EL in JSP with SpEL from Spring 3.0

Tired of old EL in JSP not being able to invoke methods on beans etc. Can I use SpEL from Spring 3.0 in my JSP:s? ...

authenticating the username ,password by using filters in java (contacting with database)

The following is the piece of java code by using filters that shows the error page at every time if the username and password is also correct. Please help me, I don't have much knowledge on this concept. String sql="select * from reg where username='"+user+"' and pass='"+pwd+"'"; rs=st.executeQuery(sql); if(rs.next()) { chain.doFilt...

How can I do username,password validation at server side by contacting with Oracle database

How can I do the username and password authentication(the username and the password is stored in the database then contact with the database to validate if the username and the password is valid or not. If the username and the password is valid then show the next page otherwise show the same login page with error message) ...

encoding issues with XHTML in JSP Page

Hi, I am using the following in my jsp page <% response.setContentType("application/xhtml+xml"); %> and the page renders properly except that some characters do not render correctly, for example the "copyright" character/symbol. However, if I use: <% response.setContentType("application/xhtml+xml;charset=UTF-8"); %> Internet expl...

How to add tab index of selectOneChoice of Oracle's ADF ?

How to add tab index of selectOneChoice of Oracle's ADF ? ...

Java/JSP HttpServletResponse issue

Hi All, In my java class I am trying to do something like HttpServletResponse.setCharacterEncoding("UTF-8"); but the code fails to compile with the message: Depend attribute is not supported by modern compiler. If I remove this line, code compiles without any issues. Can anyone shed any light on this? Thanks ...

Page Refresh problem

I have a jsp in which there are certain buttons when i am clicking on one of those, the page is refreshing but the problem is that I want to show that section of jsp where the button is on which the user has done the on click event...but the section which is coming is the top of the page but I don't want that. Please provide me with ...