I come from PHP world, where declaring a function in the middle of a php page is pretty simple.
I tried to do the same in JSP:
public String getQuarter(int i){
String quarter;
switch(i){
case 1: quarter = "Winter";
break;
case 2: quarter = "Spring";
break;
case 3: quarter = "Summer I";
break;
case 4: quarter = "Summer II";
br...
I am using "jsp:include" to include a static file in one of my jsp files. It works fine when the static html file is located inside the application folder. However if its kept outside the application folder it is not included in the JSP file.
Note: I have created a context for the folder where the static file is saved and I m able to v...
Hi there,
I am getting the following warning in Netbeans:
incompatible types
found : carPackage.port.search
required : carPackage.SearchResponse
In my JSP page, I have the following code:
CarService service = new CarService();
CarPort port = service.getCarPort();
SearchResponse searchResult = port.search("Toyota");
The error obviou...
i have a JSON object sent from the browser to the jsp page. how do i receive that object and process it in jsp. do i need any specific parsers? i have used the following piece of code. but it wouldnt work. essentially i should read the contents of the object and print them in the jsp.
<%@page language="java" import="jso.JSONObject"%>
...
Can anyone recommend a tutorial on how to write a Java Servlet which connects to MS SQL server and manages data?
I'm trying to write something which pulls products out of one database and inserts them into a stored procedure located on another database.
Thanks in advance.
...
I am in process of building up a small framework that does unit testing for JSPs. These JSPs have some custom tags, otherwise they are not any special.
Although there are numerous Java unit testing solutions available, I prefer not to use the method where a separate full-blown JSP container is launched, application deployed and results ...
Hello StackOverflow!
First of all, I've been researching this "Operation Aborted" error / bug for what seems like weeks, so here are a couple related questions and good articles if you are not familiar with it:
Why does ASP.NET cause the “Operation Aborted” Error in IE7? (so question)
Detecting cause of IE’s Operation Aborted Issue (so...
I need to make decisions in a JSP based on the user's roles. Is there a tag or EL expression that lets me do that?
...
how can i convert a JSON Object to JSONtext in a javascript function. i should pass the JSONtext as a string to JSP.
...
I want to create a JSP page or servlet that will work in 2 ways.
A user visits their own profile page:
http//something.com/profile/
Or they visit their friends page:
http://something.com/profile/FriendsName
They could also visit their own page through an explicit URL like:
http://something.com/profile/YourName
I have a servlet-mapp...
We have a Struts 2 web application that's used by pretty much every employee to manage and configure jobs for our server farm. We're working on a plan to make a dashboard for customers, so they can see their own jobs, and a very simple display of its status ("in process", "ready for proofing", "finished", etc). All of the pages the cus...
Hi, I'm using Apache 2.2 and Tomcat 6.0.18 on Windows XP. I've enabled the mod_proxy module to redirect the traffic from my Apache web server to Tomcat. I only updated the httpd.conf file to have the redirection like this:
ProxyPass /myapp http://MYMACHINENAME:8080/MyApp/Start
ProxyPassReverse /myapp http://MYMACHINENAME:8080...
Using Spring 2.5 tag library,
I have an Integer value in a command form that's rendered on my page using <form:input path="budget" htmlEscape="true" />
When the value is > 999, it renders the number as value="x,xxx" on the page. My validation isn't expecting the comma and rejects the value.
Is there a fix for the rendering, or do I n...
I create a blank project (by using eclipse plugin), create a default
jsp page, run GAE server, browse to this jsp and i got error
JRE: 1.6, Compiler: 1.6
JSP file:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://...
Hi
I am not sure if anyone else encountered this issue,
I have a java app that polls data from an external provider every second, it works fine and polls data as required -this is a console app
I have written a jsp service that does the same, it is basically returning the same data that the console app writes to the console, instead...
Can anyone suggest me any library/jar files which I can use to export my table to excel/pdf/word.
Please tell me if there is any library by which I can create reports in jsp.
...
i want the code to export tables/ reports to excel and word uisng POI
i saw the examples that came with POI but cuoldnot understand.Can anyone provide me a small/easy code to do the same.
...
I made a function which displays date on the webpage,, and i uploaded the same onto some server...
But when i changed the date of my system, i noticed that the date is dependent on client machine..
Is it not possible to get the date from actual time server and embed that code into my program..
Hope i am able to explain my doubt.. Ple...
I am writing some JSP 2.x tag files. I have searched for a few hours now, but I was not able to find doctype/schema definitions/dtds for jsp based tag files.
Does anybody knows if there are dtd/schema files to ease the pain of writing those tag files?
It's pretty painful to not have auto completion and so on in eclipse. I have to check ...
The following bit of code sets the Locale from lang param on querystring.
<c:if test="${param['lang'] != null}">
<fmt:setLocale value="${param['lang']}" scope="session"/>
</c:if>
How do I now read that variable?
I know its a bit noobish.
I need a bit of conditional logic to display one language link if the local hasn't been set ...