struts taglib fix for jsps that are not under a web module

First of all I love this IDE.
I was frustrated in 3.05 with the perceived lack of support for the struts taglibs. I know that they should work if you set up a web module BUT for people like me that work from a cvs repository which is not structured like a classic webapp, it was frustrating. But the other night I found a solution to at least getting rid of the dreaded "red" tags in the jsp files.

These are the steps.

1. Make sure that struts.jar is in your project classpath
2. Change all of your relative taglib declarations from relative to fully qaulified.

So

taglib prefix="logic"
taglib uri="/WEB-INF/struts-logic.tld"

becomes:

taglib prefix="logic" uri="http://jakarta.apache.org/struts/tags-logic"


the tld are are in the struts.jar file and IDEA seems to find them perfectly. IDEA will now let me know if my tag attributes are valid or not, a big change from before when the margin was filled with red tickers.


Hope this works for you as well,
Vinny

2 comments

Vinnie, Thanks much. I have the same issue. Unfortunately, your solution does not work for me.

I have struts.jar in the project classpath

I have changed my taglib format to:

<%@ taglib prefix="html" uri="http://jakarta.apache.org/struts/tags-html"%>

I have even tried adding a resource that points from http://jakarta.apache.org/struts/tags-html to the appropriate struts TLD file. Can you please provide more detail on how you solved this issue? Did you have to define a webapp? Did you define resources? Does IntelliJ need access to the web.xml?

BTW, I am using 3.0.5

cheers,
Steve

0

Okay...while this won't work for me in IJ 3.05, it works great in 4.01. Looks like I'm going to have to upgrade my team's IDEs. We already have the licenses, but I didn't want the slowdown before our next release. Oh well. :)

Thanks for the help.

cheers,
Steve

0

Please sign in to leave a comment.