jsp

How to display an image which is in bytes to jsp page using html tags?

Hi All : I have ByteArrayOutputStream which contains a jpeg image in bytes. My requirement is to display that image in jsp page(to display the image in front end using html tags). How do i do that?. I have refrred BufferedImage class but it confusing for me because i am new to this.. Please help me.. Thanks in advance. ...

Variables in jsp pages with "included" pages.

What are the scoping rules for variables in a jsp page with pages added to them using tags? My understanding is that an included page is essentially copied verbatum into the page, which would lead me to assume that if I've declared a variable in a Parent jsp that it would be available in the child ones. However Eclipse complains about...

How to list contents of a server directory using JSP?

When writing a JSP file, how can I get the current directory of this file at runtime (to be able to iterate the directory and list its contents)? Would some file I/O operations be restricted because of some security issues? I would prefer a solution without accessing some implementation-specific server variables / properties. EDIT: I ...

JSP Custom Tags: Is it possible to have a more than start / close tags?

After using the Django template language, I really miss being able to do things like this: {% if condition %} <!-- snip --> {% else %} <!-- snip --> {% endif %} When I am using JSP, I am stuck doing something like this: <logic:equal name="something" value="example"> <!-- snip --> </logic:equal> <logic:notEqual name="somet...

implementing a AJAX chat site

I want to implement a chat site with following features: Direct one-on-one chat with a randomly picked stranger If my conversation partner gets disconnected, I should be shifted to different stranger In short, I want to imitate http://omegle.com/ Which language is best suited to this task? Jsp and Java? PHP? ASP? Others? Should a...

How can you force recompilation of jsps in JBoss 4.2?

I hit on this nasty behavior on JBoss 4.2 in QA, and I want to nip it in the bud before we go into production and find some other corner case. A jsp calles a method that had the following signature: public void methodName(String arg) This was changed to: public void methodName(String arg, Object... args) A pre-existing JSP calle...

Is this a valid strategy for generating then including html into jsp file?

Hi all, I need a sanity check on my strategy to best fulfill the requirements of a project. Basically I have an xml file that will need to be parsed periodically and html output displayed (xslt is not an option). My thought is that I can use a single .jsp page to check an application variable that stores the last parsed date to know if ...

Strange behaviour of ArrayList

Hello everybody. I am writing a website using JSP, JSTL, Servlets and JavaBeans. At one point of my code, I am trying to use an ArrayList of objects, and a strange thing is happening: when I add the first object it is fine, and when I add a second object it adds it in the second place, but the object at index(0) gets the same values as...

How to retrieve data from 10g in java servlet & JSP

Retrieve data from database 10g in Servlet & JSP ...

Using a java object in jsp

<c:set var="nameLookup" value="${names}" /> <c:forEach var="result" items="${results}"> <tr> <td>${result.uglyDisplayName}</td> <td>${result.phonenum}</td> </tr> </c:forEach> This is an excerpt from a jsp I'm trying to edit. Results is a List<Object> being returned in the ModelAndView from the controller, of which ...

Cannot redirect with the response.sendRedirect

Hello everybody, I gooogled and googled for hours on how to make a redirect in jsp or servlets. However when i try to apply it, it doesn't work. Code that i have inside jsp page: <% String articleId = request.getParameter("article_id").toString(); if(!articleId.matches("^[0-9]+$")) { response.sendRedirect("index.js...

generating a tree representation for contents of webapp folder

All, We have a ton of JSP includes in our deeply nested webapp folder.It is annoying to digg 5or 6 levals down to find out which JSP is being included where! is there a easy way to generate a nice tree like structure(on windows) showing the jsp structure? something like this: home.jsp   billing.jsp    creditcard.jsp Thanks ...

jsp tag files and log4j

Whats the best way to add log4j logging to a jsp tag file.. I've got as far as importing the logger class.. <%@ tag import="org.apache.log4j.Logger" %> But having a bit of trouble initialising the logger object. <% Logger log = Logger.getLogger("xxx.xxx.xxx.xx"); %> Because I'm using a tag file with a .tag extension, what do I put ...

Liferay portlet development with eclispe and pugins SDK

I am not sure, if this is a progamming question in the scope of this website. I am trying to create some simple portlet, which has some jsp Pages communicating with the java backend and vice versa. But any documentation states differen procedures, filenames and functions, than those used in the basic portlet, created by the Liferay plugi...

JQuery File Tree using JSP Connector

Hi, I have a problem trying to get JQueryFileTree to work, http://abeautifulsite.net/notebook.php?article=58 I have set the root folder to the images/ folder inside my working folder, can someone please help? There are no jQuery or Javascript errors, I am sure the error is in teh JSP file or to do with the directory permissions, eve...

How do you check the browser's user agent in a JSP page using JSTL, EL?

I need to check the browser's user-agent to see if it is IE6. However I shouldn't use scriptlets (we have a strict no scriptlets policy) to do this. Currently I use <% String ua = request.getHeader( "User-Agent" ); boolean isMSIE = ( ua != null && ua.indexOf( "MSIE" ) != -1 ); %> <% if( isMSIE ){ %> <div> <% } %>...

Cannot pickup id with JQuery for the JSF textarea

Hello everybody I have a little problem I am trying to use MartkItUp JQuery rich text editor on JSF textarea component. MY form looks pretty much like this: <h:form id="comment"> <h:inputTextarea id="commentBody" cols="10" rows="10" value="#{postComment.commentBody}" required="true" requiredMessage="Comment Body i...

redirect from jsf ?

Hello everybody, I am working on application with jsp, jstl and jsf for my college project, thats being said, I am as well very new to jsf. Everything is going great so far. However, I seems to have a problem figuring out how to do redirect from managed bean to page with dinamyc parameters. For example article.jsp?article_id=2 Can som...

Using JNI in JSP page?

Hi friends, how to use JNI in JSP page?.In net i found that 1. because if anything goes seriously wrong in the C part of your application, it will very likely crash your J2EE server, downing all other web services and applications it is running. because the 'reactivatable' nature of web applications means there is no guaran...

JSP Servlet and Web Programming

I use java mostly for gui programming and php for web programming but i really don't like not having a statically typed language. For my next project i would like to use java instead of php. What is the difference between jsp and servlets? ...