Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8838075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:53:46+00:00 2026-06-14T09:53:46+00:00

I was ok to define it in struts.xml config. <action name=getImage class=my.action.GetImageAction> <result name=success

  • 0

I was ok to define it in struts.xml config.

<action name="getImage" class="my.action.GetImageAction">
      <result name="success" type="stream">  
          <param name="contentType">image/jpeg</param>  
          <param name="inputName">imageStream</param>  
          <param name="bufferSize">1024</param>  
      </result>  
</action>

And I am now trying to define it by annotation on the class with namesapce, result path, and I have no idea how to do it. Please help 🙂

I have tried

@Namespace("/my/namespace")
@ResultPath("/")
@Result(name = "success", type = "imageResult")
public class GetImageAction extends ActionSupport {
.....
@Override
@Action("/getImage")
public String execute() throws Exception {
.....

And I got an error

HTTP Status 404 - No result defined for action 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T09:53:48+00:00Added an answer on June 14, 2026 at 9:53 am

    As the error says the results have to be defined at the Action.
    The definition would look like this

    @Action(value = "getImage", results = { @Result(
            name = "success", 
            type = "stream", 
            params = {"contentType", "application/pdf" }) })
    

    In the example you see the type too and how to define the contentType.

    And the stream will be returned by the “getFileInputStream”-method:

    public InputStream getFileInputStream() {
    
                return fileInputStream;
        }
    

    the “getContentDisposition”-Method has to be available in the Action-class

    public String getContentDisposition() {
        return "attachment; filename=" + getFilename() + ".pdf";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<action name=userLogin class=com.cc.ad.web.common.UserLoginAction> <result name=error>/user-login.jsp</result> <result name=redirect type=redirect>${retUrl}</result> <result name=customerRedirect type=redirect>${customerRedirect}</result> <result name=supplierRedirect type=redirect>${supplierRedirect}</result>
In Struts say we define some form with the name TaskForm in struts-config.xml .
I am using Tiles with Struts2. In struts.xml I need to define <result-types> for
javax.servlet.ServletException: Error creating bean with name 'userService' defined in class path resource [applicationContext.xml]: Cannot
This is my struts.xml <struts> <include file=example.xml/> <constant name=struts.devMode value=true /> <package name=register namespace=/register
I have define variable error in struts.properties as follows: error=this is an error Now
In struts the action scope was defined as <action scope=session .../> How do you
I'm using Spring to manage the struts 2 action beans. I am trying to
My issue is : I define class (generator) inside of which I define a
I've got a huge struts.xml file and I want to add some logic in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.