Results 1 to 3 of 3
  1. #1
    gauravmanral's Avatar
    gauravmanral is offline Gaurav Manral
    Join Date
    Jul 2011
    Location
    Delhi
    Posts
    37
    Rep Power
    0

    Question Error sending request to the Action class from a href link in struts2

    When i use this code to send request to the Action class from a link in struts2, it works fine.

    <a href="<s:url action="link"/>">Add New Case</a>

    struts.xml

    <action name="link" class="casediary.JudicialCaseRegister" method="execute">
    <result name="clientlist">user.jsp?pageinclude=ancar</result>
    <result name="error">user.jsp?pageinclude=errancar</result>
    </action>

    But when i am using this link, i am getting HTTP Status 404 - /Judicial/link error.

    <a href="link">Add New Case</a>

    struts.xml remains the same both time.

    How to do this, please help.
    Last edited by gauravmanral; 06-01-2013 at 09:05 AM.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,234
    Rep Power
    19

    Default Re: Error sending request to the Action class from a link in struts2

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    gauravmanral's Avatar
    gauravmanral is offline Gaurav Manral
    Join Date
    Jul 2011
    Location
    Delhi
    Posts
    37
    Rep Power
    0

    Default Re: Error sending request to the Action class from a link in struts2

    I got the answer friends. I had to do this-

    <a href="link.action">Add New Case</a>

    Thanks BTW.

Similar Threads

  1. Sending request to a web-service
    By sehudson in forum Web Frameworks
    Replies: 1
    Last Post: 03-06-2011, 09:32 AM
  2. how to send a link through action class in struts
    By Kadiyala in forum New To Java
    Replies: 0
    Last Post: 02-17-2011, 07:44 AM
  3. resource not found error- Struts 2 (Struts2 in action- Manning)
    By JavaNoobie87 in forum Web Frameworks
    Replies: 0
    Last Post: 01-17-2011, 10:09 AM
  4. Link request not permitted
    By Wedgetail in forum New To Java
    Replies: 2
    Last Post: 11-25-2010, 04:23 AM
  5. Struts2 Sending URL
    By sandeep.ctg in forum Web Frameworks
    Replies: 0
    Last Post: 04-13-2010, 06:59 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •