jsp

Is it bad practice to put view code in the controller?

In MVC (such as JSP and Spring), is it bad practice to view related code in the controller? In my case, the controller does some work and then hands off the results to the view (JSP). In the case of a status message, I can pass the entire message text to the view, or pass a key and let the JSP map it to the message text. Example: Mess...

Geocortext IMF framework Null reference exception

Still having issues with this problem. Please help if you can. So I am trying to fix a piece of code using the Geocortex IMF framework. I get an error on line 40 which is basically pulling a null exception. It is a mix of java and html. For some reason I can't seem to find out why the error is pulling up a null. Even if I load the v...

Problem with moving JSPs under WEB-INF directory

Hello I am facing a problem when I move my JSP files along with CSS and JS files under WEB-INF/web/ directory. The problem is that, when a JSP page loads, it does not load CSS and JS files. Please help if you have any idea about it. Thanks Umar ...

Struts JSP : set textfield value from session information

Hi, I have a DLPUser object in my session, this DLPUser is basically a container for Strings, ints and some useful info for me. (this is a fragment of code inside my action class in java) Map <String, Object> session = ActionContext.getContext().getSession(); session.put("logged-in","true"); session.put("user", user); //user is DLPUse...

question about Character encoding in Web

let's say I have a JSP Page(i just list part of it, please don't mind): <%@ page language="java" contentType="text/html;charset=UTF-8"%> <form> <input type=input> </input> 中華<!--character with BIG5 encoding> </form> and In server side I use this request.setCharacterEncoding("UTF-8"); my problem is: If i use...

How to test JSP TagExtraInfo ?

I consistently have troubles getting my TagExtraInfo implementations to work properly. I have one implementation that works, and one that doesn't and I unable to see the difference between the two. And all the IDE's seem to have have "bugs/features" regarding this, which makes it hard to see where the problem actually is. The relationsh...

JSP syntactical error in scripting

I don't understand why the first program in JSP is working, but the second program is giving an error: <% for(int i=0;i<10;i++){ out.print("hello"); } %> <% for(int i=0;i<10;i++){ <%= "hello" %> } %> ...

Functions with HTML codes and Sessions in JSP

Hi I am working on JSP. I need to have functions in JSP so that can implement reusage of codes. the stuff to be included in Functons are 1. Session variables. 2. HTML codes - For page desiging depending on the condition check. 3. the business logic - in JAVA Can any one help me out on how to implement this and what t...

How to do this using java expression language

Let just say i have the following java object that I wish to read in my jsp using el: class A { Map map = new HashMap(); int count; String getAttribute(String attrName) { return map.get(attrName); } String getCount() { return count; } } I can call count ...

Can't retrieve urlencoded umlauts. [solution: use UTF8]

Hello, I'm programming some websites with JSP-Scripting and I encounterd a strange problem with urlencoded web-formular parameters. The site itself is encoded in iso-8859-1. I have a simple webform with a field called description. If I enter german Umlauts or specialchars like "ü" or "ß", these get automatically urlencoded. But if I wa...

How to get browser information in JSP?

How to get Client IP and Browser information using JSP?. ...

Radiobutton validation.

The question is on the client side validation using java script. Significant parts of the program related to the question are given below.. ... <form name="results" action="" method="post"> ... <input type="radio" name="id" value="<%= id_edit %>" /> <!-- Don't bother about id_edit --> .... <input type="button" name="Edit" value="Edit" ...

How to get the login user name in JSp?

Hi all, I need to get the users Loging name from NTLM . Any one who knows?. Thanks you :). ...

How to pop up a new window in JBoss AS portlet?

Working in the JBoss AS portlet we have been unable to open a jsp page in a new portlet. We are fairly new to JBoss, and unsure how to go about it. We want a link in a portlet that, when clicked, opens a new window and load into it a jsp. Are there web.xml/WEB-INF changes? ...

How can I call a tiles page directly from a JSP?

Hi there, I was wondering how I can call directly a tiles page from a jsp. Thanks in advance. ...

JSP displaying single and double quotes as symbol

I have a JSP page retrieving data and when single or double quotes are in the text they are displayed as this symbol ”. JSP Code: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>General</title> </head> <body> <h1> <%= order.getDescription %> </h1> </bod...

How Firefox renders links

I just would like to share some of my observation on how Firefox 3.5 on Ubuntu Jaunty Jackalope renders HTML: I have the following entries in my JSP page: <a title="myLink" href="[some url]">link 1</a> <a title="myLink" href="[some url]">link 2</a> <a title="myLink" href="[some url]">link 3</a> <a title="myLink" class="hiddenLink" h...

why use jsp:useBean here but not just create a new object ??

In a JSP page, there is such code: <jsp:useBean id="checklog" class="com.google.admin.guard.CheckLogBean" scope="session" /> and then <% checklog.checkit(); %> Why we don't just create the object with new com.google.admin.guard.CheckLogBean? What's the benefit of doing this? And in the source code, there is no such class, but wh...

right align property not working while giving width to tds

I am having a jsp and some jspf in which I want short,long mid term fields as well as heading to be right aligned but it is not working as soon as I remove the width property from my style right align start working.Although the style is working in one of the included jsp, but not working the jsp which is including all the other jspf and ...

How to get selected items in OpenSymphony WebWork select

I inherited somebody else's code, and it uses OpenSymphony WebWorks, which I've never encountered before. I'm trying to "cargo cult" a small fix to it. It includes the following in a JSP: <ww:select name="'selectedOrigDoctypes'" value="selectedOrigDoctypes" size="5" multiple="true" cssClass="'doctype'" list="origDoctypeCho...