Enable CTRL+click link for file?

I have a struts.xml file in my Struts web project that I would like to be able to use the CTRL+click link ability that intelliJ offers.  Currently with the code below I am able to CTRL+click on "com.afs.web.action.ProcessOrder2CheckoutAction" and it will bring up my .java file.  Alternatively, I would love to be able to CTRL+click on "/struts/orderProcessing/processOrder.jsp" and it bring up my .jsp page.  However it says "Cannot find declaration to go to".  Is there a way to get intelliJ to recognize this link?  Or set some sort of relative directory so I can use the CTRL+click ability?

EXAMPLE CODE SNIPPIT (from struts.xml):

<action name="ProcessOrder2Checkout" >
  <result>/struts/orderProcessing/processOrder.jsp</result>
  <result name="error">/struts/orderProcessing/error.jsp</result>
</action>

0
4 comments
Avatar
Permanently deleted user

I'm not sure how you could do it via Ctrl+Click. I assume that /struts maps to a controller servlet. That means the mapped path does not match to the actual system path for the JSP file. An alternative would be to use the Find File action (Ctrl+Shift+N or Navigate > File from the menu). If you have something selected, the Find File dialog box will pre-populate with that. So just select the file name ("processOrder.jsp") without the path by either double clicking on it or using  the Ctrl+W action to select it. (With Ctrl+W, as you hit it in succession, it increases the selection to the next natural scope point. And Ctrl+Shift+W deselects). Then open the Find File dialog and hit enter.

0

Please make sure your web application and Struts 2 facet are setup properly. See http://confluence.jetbrains.net/pages/viewpage.action?pageId=35367 for further information.

0

That worked.  I needed to make sure I added all my struts.xml filesets.  Thanks for telling me to RTFM - sometimes I need to be reminded!

Cheers.

0

No problem, you're welcome. Feel free to ask if you encounter any more problems or have suggestions.

0

Please sign in to leave a comment.