jsp

Scope of JavaScript Variables?

How can I access an JavaScript variable from within an JSP page ? ...

Using a Filter to serve a specific page?

Hi, I am using a class which implements Filter for my jsp stuff. It looks like this: public class MyFilter implements Filter { public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { request.getRequestDispatcher("mypage.jsp").forward(req...

Datagrid in JSP

Hi, I need to create a Datagrid with a radiobutton column in JSP. The grid is to be binded dynamically to a result set and be populated accordingly. This result set is obtained as a result of search in the database. Please do help with a sample source code, or a useful link for the same. Thanks in advance, Geetha ...

reload a form with the same parameter of the previous

Hi every one, I have really a problem that I don't know how to deal with it. I am using JSP and Servlet with the Eclipse IDE. First of all, the user fill an html table with the values that he has selected and written in the form. after that he will find his parameters displayed in the html table. the problem now is : the table contains...

sending parameters with ajax

I am trying to send parameters that I get from a table in my jsp to other JSP using ajax. I am using the followinf function to send all values to JSP: ajaxForm but I don't know why the send failed every time I run it: Here is the javascript function: function editarow() { var xhr = getXhr(); xhr.onreadystatechange = function()...

How to generate dynamic drop down lists using jQuery and jsp?

I have a list of type A, in which each element contains another list of type B. I want to create a form in which when a user selects a value from the drop down list containing values of A, another drop down to populate values based on selected item's list of Type B. I am new to jQuery but I know that it is convenient to do this using jQu...

filling a form with parameter already selected using ajax

hi every one, My goal untill now is to fill a form with values from a table (html table). it is a kind of refreshing the form. so the user who wants to modify the html table through the form must prefill the form with values wich he already selected. I used the DOM to acces to each row and cell in the table and i used ajax to pass param...

Can I access Spring session-scoped beans from application-scoped beans? How?

I'm trying to make this 2-player web game application using Spring MVC. I have session-scoped beans Player and application-scoped bean GameList, which creates and stores Game instances and passes them to Players. On player creates a game and gets its ID from GameList and other player sends ID to GameList and gets Game instance. The Game ...

show notification in jsp page depending on a flag?

I have HTML code in the jsp page that I want it to be displayed only after the user submits data and get redirected to this page. So I have to set a success flag as a parameter in the link like: http://site.com/page?success=true Not sending in the request because it will be lost since I am redirecting I don't want to send it in the li...

Java (JSP/Servlet): equivalent of getServletContext() from inside a .jsp

How should I access the ServletContext from a .jsp? For example, how can I call the getRealPath method from inside a .jsp. Here's a Servlet, which works fine: protected void doGet( HttpServletRequest req, HttpServletResponse resp ) throws ServletException, IOException { resp.setContentType( "text/htm...

Java (JSP): repeating the contentType header in a "sub-jsp"

What happens when headers are repeated in a .jsp you include in another .jsp? For example if example.jsp starts with this: <?xml version="1.0" encoding="UTF-8"?> <jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page"&gt; <jsp:directive.page contentType="text/html; charset=UTF-8" /> <div class="content"> <jsp:include page="s...

was5 resources.xml

is there a way to read this file inside a JSP/Servlet? ...

Populate JSP dropdown with database info

I'm looking for the way to populate a JSP dropdown. I want that when the JSP loads it fills the dropdown with the info that I have in a database table. I'm including the code of my class that will create the array and fill it with the database info. What I don't know is how to call that class from my JSP and fill the dropdown. // this ...

Include static file in JSP with variable filename on WebSphere 6

I'm struggling with including a static file into my JSPs on Websphere 6.0.2.17. I tried this: <% final String MY_DIR = ResourceBundle.getBundle("mybundle").getString("props.pages.wcm"); %> <% final String page = ResourceBundle.getBundle("mybundle").getString("page"); %> <% final String inc = MY_DIR + "/" + bonus; %> <%@include file="<%=...

how to get the button value from jsp to servlet

hi, how to get the button value from jsp to servlet in jsp: <input type=button name=bt value=gi onclick="document.frm.submit();"></input> and in servlet like that: String gi =request.getParameter("bt"); System.out.print("button value" +gi); result=null thanks ...

JSP Servlets simple question.

What is the simplest way to use a variable in the URL in servlets. Eg. http://somesite.com/MyServlet/[ID] ...

How do I convert this h:form into xhtml form

<h:form id="login"> Email: <h:inputText id="email" value="#{user.email}"/> <h:commandLink id="signupLink" value="signup" action="#{userManager.validate}"/> </h:form> To something like this: <form action="#{userManager.validate}"> Email: <input type="text" id="email" value="#{user.email}"/> <button type="submit" value=...

html/js: Refresh 'Select' options

Hi, There's a class 'Car' with brand and model as properties. I have a list of items of this class List<Car> myCars. I need to represent 2 dropdowns in a JSP page, one for brand and another for model, that when you select the brand, in the model list only appear the ones from that brand. I don't know how to do this in a dynamic way. An...

Facelets error page as the response has already been committed. jsf

Hello, I perform this redirect :- objExternalContext.redirect("http://blogger.blogdns.com:8080/Blogger/Common/LoginRequestProcessor.jsp;jsessionid=" + objHttpSession.getId() + "?j_username="+ userName + "&j_password=" + password + "&rememberMe=" + rememberMe); to page LoginRequestProcessor.jsp :- <%@page contentType="text/html" p...

question for jsp coding

I am reteriving the set of values inside a table from database in a jsp page then it is in the form of link. Now I want to click that value and move to another jsp page. How to code the program so that it can recognise that value and it can move to the next desired page. But I unable to do that. please help me.... ...