Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Problem with html:link forward="" tag

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to use modules to simulate a struts application on a larger scale. I have been having this problem with my forward action tag so I started using

<html:link action="/viewSearch">Search for Employee</html:link>

which was working fine. Now I start using L

<html:link forward="/viewSearch">Search for Employee </html:link>

and the browser is complaining of a MalformedURLException.

Here is how my directory is set up:

MiniHR/index.jsp

MiniHR/employee/search.jsp

MiniHR/reports/menu.jsp

MiniHR/WEB-INF/struts-config.xml
MiniHR/WEB-INF/struts-config-employee.xml
MiniHR/WEB-INF/struts-config-reports.xml
MiniHR/WEB-INF/web.xml

______________________

There is nothing wrong with my stuts files because I can access menu.jsp just fine.

I am having two issues

1) html:link forward="/viewSearch">Search for Employee </html:link>

This gives me this error:
javax.servlet.jsp.JspException: Cannot create rewrite URL: java.net.MalformedURLException: Cannot retrieve ActionForward named /viewSearch

Like I said previously I have used this tag before i even started working with modules and it has never worked so i started using

<html:link action="/viewSearch">Search for Employee</html:link> which works fine. I just want to know why the forward attribute from the html:link tag doesn't work.

My second prob is that since I am using the action attribute of the html:link tag I now get something that says :


javax.servlet.ServletException: No action config found for the specified url.

From my index.jsp page I use the html link page to hit my struts config which is:


struts-config.xml
<global-forwards>
<forward name="viewSearch" path="/employee/viewSearch.do"/>
</global-forwards>

This should map to my struts-config-employee.xml:

<action-mappings>
<action path="/viewSearch" forward="/search.jsp"/>
<action path="/search"
type="com.jamesholmes.minihr.SearchAction"
name="searchForm"
scope="request"
validate="true"
input="/search.jsp">
</action>
</action-mappings>


There is some problem in this step so I am given:

org.apache.struts.chain.commands.InvalidPathException: No action config found for the specified url.

If I mapped directly to the module that works but trying to mapped to one config file to the next is causing problems can anyone help with my two probs?

Jamon
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

1) html:link forward="/viewSearch">Search for Employee </html:link>



Use "viewSearch" instead of "/viewSearch".

and let us know whether this helps or not !!
 
Terril Douglas
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Sagar Rohankar:


Use "viewSearch" instead of "/viewSearch".

and let us know whether this helps or not !!



Thanks Sagar this solved the problem pesky forward slash !

Terril
 
Sagar Rohankar
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome Terril ,

This is the same problem i have caused some time before !!
 
We've gotta get close enough to that helmet to pull the choke on it's engine and flood his mind! Or, we could just read this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic