jsp

sending a selected value from a dropdownlist to a servlet with xhr

I am trying to send the clicked value of a dropdown list to my servlet to run a SQL query using the value received. To do it I am using Ajax like that: function showProject(prj) { xmlhttp = GetXmlHttpObject(); if (xmlhttp == null) { alert ("Browser does not support HTTP Request"); return; } var url = "Se...

Tomcat JSP(2.0) Document how to stop automaticly closing empty body tags with /> instead of </tagname>

The question is. If I use JSP Documents (or JSP 2.0) and If I put a TAG without a BODY it is automaticly closed I dont want that. so If I have <div id=....> </div> it is automaticly converted to <div id=.../> How I can stop this ? I am using tomcat is there any configuration about that ? P.S. the reason to want to stop it is because ...

Custom JSP tag - How do I get the body of the tag?

I have a custom jsp tag like this: <a:customtag> The body of the custom tag... More lines of the body... </a:customtag> In the custom tag, how can I get the text of what the body is? ...

server controlled or Synchronized web slide show?

I am creating a e-learning application , where the students (wireless) connect to the teachers machine, the teacher hosts a tomcat server. the teacher has a set of HTML web-pages(each of which can be thought of as a slide). and the students can view a web slide-show on his/her browser... the problem is.... i want the pages on the stud...

Security comparison between JSP and ASP.Net

Is there any comparison to show why JSP/ASP.Net is better from security point of view? As I think, security depends on the server security, and website architecture and implementation, and only a name like JSP/ASP.Net will not guarantee your website and will not make hackers to run away!! Is there any study or article to show bugs or se...

Automatically tidy up JSP/JSF files

Hi, I am working on a webapplication and I do most of the XHTML stuff in an editor. Every once in a while I froget to close a tag or mess up the nesting (we all get distracted sometimes ;-)). So I commpile, package and run my webapp (using maven mvn clean package jetty:run-war only to notice that displaying the view (where I messed up ...

Writing a Servlet that checks to see if JSP's exist and forwards to another JSP if they aren't

UPDATE: To clarify a generic error catcher that catches 404's doesn't have enough granularity for me. I need to do this only if the jsp is in a particular directory and then only if the filename contains a certain string. /UPDATE I've beeb tasked with writing a servlet that intercepts a call to and JSP in a specific directoy, check th...

Browser show incomplete JSP data

I am using JSP, Struts 1.3 and Apache Tomcat 5.5. For some reason response from JSP is being truncated and complete information is not shown. Class generated from the problem JSP page looks just fine. There are no any errors logged in Catalina's logs. I have no idea how this issue can be fixed. Update: I'm sure that I'm looking in the ...

How to use bean in JSP?

How to use bean in JSP with only <jsp:useBean>, not MVC? Assume you have a grade.txt file which contains following data: Tom 90 Jerry 70 Katy 80 John 60 It asks you to create a bean named grade.java, a JSP page named graderesult.jsp, and a html page named gradecheck.html. gradecheck.html provides a input textbox and a button submit...

How to manipulate the history of the web page?

Here is my what I have <div id=A></div> <div id=B></div> <input type="button" value="ChangeA" onClick="createTableA();"> <input type="button" value="ChangeB" onClick="createTableB();"> So in my jsp file, I use javascript and jQuery to manipulate the content of those two div dynamically. For example, if I click on changeA, the function...

Setting the default jsp view with spring mvc

I want to set one of jsp files in my jsps folder as the default view for the application. Is there any way we can tell in <welcome-file-list> that abc.jsp needs to be default and it can be found in such and such path. Also the url pattern is html so is there a way it can be mapped in Spring MVC. For example - When a user types www.examp...

Amount of data stored in session

What technique should we use to make the httpsession object not loaded heavily with data. Example : Request 1 ---- > httpSession loaded with an arraylist of 50,000 different objects. session.setAttribute("data",arraylist); Request 2 ---- > httpSession loaded with an arraylist of 40,000 different objects. session.setAttribute("dat...

where should i get javax.media.jai.widget package,how to copy tiff file,how to get pages frpm tiff file

i have to show thumbnil on the tif file in a browser(IE,mozilla firefox etc),i.e all pages of tiff file shld displayed,clicking on that thumbnil particular page can be viewed.For that i Want to get pages of tiff files.and I need to copy tiff file from 1 location to other like there are 10 comp's in lan,i m on 1st computer,the tiff file c...

Checking attribute exists in JSP

Hello, I have some classes which extends a superclass, and in the JSP I want to show some attributes of these classes. I only want to make one JSP, but I don't know in advance if the object has an attribute or not. So I need a JSTL expression or a tag which checks that the object I pass has this attribute (similar to in operator in java...

Buttons size not equal in IE and Firefox

I have few buttons on my jsp page and I am using the style as : *.buttonblue { background-color: #003366; border-color: #99CCFF; color: #FFFFFF; font-family: Verdana,Arial,Helvetica; font-size: 8pt; font-weight: bold; height: 20px; display:inline; line-height: 1.2; text-align: center; m...

Java String Replace and null characters

Testing out someone elses code (of course it was ...) , I noticed a few JSP pages printing funky non-ascii characters. Taking a dip into the source I found this tidbit. // remove any periods from first name e.g. Mr. John --> Mr John firstName = firstName.trim().replace('.','\0'); Does replacing a character in a String with a null ch...

best way for jsp visitor hit counters

what is the best way for creating a jsp visitor hit counters? is it better to use txt file and save the hit value into a file, or create a table in database??? or use session/cookie to count the users whom have visited the website? ...

Hidden features of JSP/Servlet

I am interested in your tricks etc used when writing JSP/Servlet. I will start: I somewhat recently found out how you can include the output of one JSP tag in an attribute of another tag: <c:forEach items="${items}"> <jsp:attribute name="var"> <mytag:doesSomething/> </jsp:attribute> <jsp:body> <%-- when using jsp:attribut...

JspC in jboss 4.2 distribution

Where can I find the org.apache.jasper.JspC class in the JBoss 4.2 distribution (exactly a 4.2.2.GA one)? Thanks Claudio ...

How to import constants in a JSP page

Are there any better ways to use constants in a JSP than: <%@ page import="static package.Interface.NAME"%> Is there any downside to using these (outside of mixing code/content)? Thanks! ...