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 9186849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:37:51+00:00 2026-06-17T19:37:51+00:00

I have a class extending the AbstractExcelView class of Spring which renders an XML

  • 0

I have a class extending the AbstractExcelView class of Spring which renders an XML file. Within this class, I am injecting my Service bean for use. I am autowiring and component scanning my classes, and I would like to also do the same with this view class, but I am not clear how (or if it can be done). Here’s what I’m trying to annotate from the config:

<bean id="export.xls" class="com.my.views.ReportExcelView">
<property name="url">
    <value>/excel/template</value>
</property>
<property name="service" ref="testingService"/>

I am able to annotate the class with @Component, and the service with @Autowired, but I don’t know of a strategy to annotate the URL. What I’d really like to do is condition it within the buildExcelWorkbook() call (based on something in the request), but it seems there is some initialization done before this, as I get an error trying to use my excel template with this method that indicates it does not have a handle to the Excel sheet. Any recommendations?

  • 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-17T19:37:53+00:00Added an answer on June 17, 2026 at 7:37 pm

    So your ReportExcelView probably looks like this right now. Make sure you use @Resource to wire a simple String.

    package com.ex.springbasicex.view;
    @Component
    public class ReportExcelView{
        @Resource(name="myUrl")
        String url;
    
        @Autowired
        Service service;
    
        public String getUrl() {
            return url;
        }
    
        public void setUrl(String url) {
            this.url = url;
        }
    }
    

    Your context config probably should be like what is below using scanning. Below is how to set the myUrl String resource.

    <context:component-scan base-package="com.ex.springbasicex.view"  />
    <bean id="myUrl" class="java.lang.String" >
        <constructor-arg>
            <value>/excel/template</value>
        </constructor-arg>
    </bean>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a class extending SimpleXMLElement which loads an XML containing translations for
I have a class extending JFrame which contains group of radioButtons and a submit
I have a class extending a DialogFragment and in this I am showing a
I have a class (foo) extending ListActivity which instantiates a class (fooAdap) extending ArrayAdapter.
I have class SuperYo extending class Persona, like this: public class SuperYo extends Persona
Is it possible to have a class extending SurfaceView within the activity class as
Well, I have a class extending broadcastreceiver which is listening for messages. Now whenever
I have a class which is extending Application public class MyContext extends Application {
I have a custom Zend Validate class extending Zend_Validate_Abstract The validator is a file
I have a lift project in which there is a class extending RestHelper that

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.