jsp

Arrays of Arrays in Java

This is a nasty one for me... I'm a PHP guy working in Java on a JSP project. I know how to do what I'm attempting through too much code and a complete lack of finesse. I'd prefer to do it RIGHT. :) Here is the situation: I'm writing a small display to show customers what days they can water their lawns based on their watering group...

How can I refactor HTML markup out of my property files?

I've recently inherited a internationalized and text-heavy Struts 1.1 web application. Many of the JSP files look like: <p> <bean:message key="alert" /> </p> and the properties files look like: messages.properties alert=Please update your <a href="/address.do">address</a> and <a href="/contact.do">contact information</a>. with ...

What Web Application Framework for Java is Recommended?

I am considering creating my own website using Java and am trying to decide what framework to use. However, doing a quick search for Java frameworks returns more than 50 to choose from! My website is just going to be for my own enjoyment of building it in the beginning, but if it becomes popular it would be good for it to have some scala...

Should I be doing JSPX instead of JSP?

Using JDeveloper, I started developing a set of web pages for a project at work. Since I didn't know much about JDev at the time, I ran over to Oracle to follow some tutorials. The JDev tutorials recommended doing JSPX instead of JSP, but didn't really explain why. Are you developing JSPX pages? Why did you decide to do so? What are the ...

Problems while submitting a UTF-8 form textarea with JQuery/AJAX

I am having problems submitting forms which contain UTF-8 strings with Ajax. I am developing a Struts web application which runs in a tomcat server. This is the environment i set up to work with UTF-8: I have added to tomcat's conf/server.xml the attributes URIEncoding="UTF-8" useBodyEncodingForURI="true" into the Connector tag. I have...

jsp debugging in intellij idea

does anyone know how to debug JSP in intellij idea? when i set breakpoint in my jsp files, those breakpoints never seem to take effect. debugger never hit them. IDEA seems to think that the breakpoints are valid. i do see a red dot placed to the left of the line where i place my breakpoint. i read in intellij forum that someone indic...

How can I set the welcome page to a struts action?

I have a struts-based webapp, and I would like the default "welcome" page to be an action. The only solutions I have found to this seem to be variations on making the welcome page a JSP that contains a redirect to the action. For example, in web.xml: <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> a...

What is the best way to migrate an existing messy webapp to elegant MVC?

I joined a new company about a month ago. The company is rather small in size and has pretty strong "start-up" feel to it. I'm working as a Java developer on a team of 3 others. The company primarily sells a service to for businesses/business-type people to use in communicating with each other. One of the main things I have been, and wi...

Mixing jsp and jsf

I will elaborate somewhat. Jsf is kind-of extremely painful for working with from designer's perspective, somewhat in the range of trying to draw a picture while having hands tied at your back, but it is good for chewing up forms and listing lots of data. So sites we are making in my company are jsf admin pages and jsp user pages. Proble...

Which jstl url should I reference in my jsps?

I'm getting the following error when trying to run a jsp. I'm using Tomcat 6.0.18, and I'd like to use the latest version of jstl. What version of jstl should I use, and which URL goes with which version of jstl? I'm getting this error "According to TLD or attribute directive in tag file, attribute key does not accept any expressions"...

Free JSP plugin for eclipse?

I was looking out for a free plugin for developing/debugging JSP pages in eclipse. Any suggestions? ...

Importing JavaScript in JSP tags

I have a .tag file that requires a javascript library (as in a .js file). Currently I am just remembering to import the .js file in every JSP that uses the tag but this is a bit cumbersome and prone to error. Is there a way to do the importing of the .js inside the JSP tag? (for caching reasons I would want the .js to be a script impo...

Embedded custom-tag in dynamic content (nested tag) not rendering.

Embedded custom-tag in dynamic content (nested tag) not rendering. I have a page that pulls dynamic content from a javabean and passes the list of objects to a custom tag for processing into html. Within each object is a bunch of html to be output that contains a second custom tag that I would like to also be rendered. The problem is th...

How can I replace newline characters using JSP and JSTL?

I have a list of bean objects passed into my JSP page, and one of them is a comment field. This field may contain newlines, and I want to replace them with semicolons using JSTL, so that the field can be displayed in a text input. I have found one solution, but it's not very elegant. I'll post below as a possibility. ...

How do I HTML Encode all the output in a web application?

I want to prevent XSS attacks in my web application. I found that HTML Encoding the output can really prevent XSS attacks. Now the problem is that how do I HTML encode every single output in my application? I there a way to automate this? I appreciate answers for JSP, ASP.net and PHP. ...

Can I submit a Struts form that references POJO (i.e. not just String or boolean) fields?

I have a Struts (1.3x) ActionForm that has several String and boolean properties/fields, but also has some POJO fields. so my form looks something like: MyForm extends ActionForm { private String name; private int id; private Thing thing; ...getters/setters... } In the JSP I can reference the POJO's fields thusly: ...

How do I get rid of "Cannot resolve property key" in fmt:message tags in JSPs in Intellij

This one has been bugging me for a while now. Is there a way I can stop Intellj IDEA from reporting missing keys in tags? My messages are not stored in property files so the issue does not apply in my case. I'm using IntelliJ IDEA 7.0.4 ...

struts2: how to substring in jsp?

hi, is there a way to substring in JSP files, using struts2 technologies? I mean, struts2 has its own taglib and also uses ognl. How can I get a substring from a stacked value or bean value? thanks in advance. stv ...

In JSTL/JSP, given a java.util.Date, how do I find the next day?

On a JSTL/JSP page, I have a java.util.Date object from my application. I need to find the day after the day specified by that object. I can use <jsp:scriptlet> to drop into Java and use java.util.Calendar to do the necessary calculations, but this feels clumsy and inelegant to me. Is there some way to use JSP or JSTL tags to achieve th...

Formatting a long timestamp into a Date with JSTL

I am pulling a long timestamp from a database, but want to present it as a Date using Tags only, no embedded java in the JSP. I've created my own tag to do this because I was unable to get the parseDate and formatDate tags to work, but that's not to say they don't work. Any advice? Thanks. ...