PDA

View Full Version : about pdf view


wam
Jun 18th, 2007, 11:12 AM
Hi,

I am trying to run a pdf view for the first time.
These are the steps I've done:

1) In my app-servelt.xml I have added a bew View resolver:

<bean id="pdfViewResolver" class="org.springframework.web.servlet.view.XmlViewResolv er">
<property name="order" value="1"/>
<property name="location" value="/WEB-INF/views.xml"/>
</bean>


and in views.xml I have a bean entry like this:
<bean name="xxxpdf" class="xxx.pdf.MyPdf"/>


while I keep also the original InternalResourceViewResolver which solves the jsp views:


<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResou rceViewResolver">
<property name="viewClass">
<value>org.springframework.web.servlet.view.JstlView</value>
</property>
<property name="prefix">
<value>/WEB-INF/jsp/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>


2) I have created a PdfView class MyPdf which extends AbstractPdfView.

but my pdf view does not seem to work(resource not found).

Any idea?

Marten Deinum
Jun 18th, 2007, 11:59 AM
Just to be sure also specify an order attribute on the InternalResourveViewResolver. Make sure that is comes AFTER you XmlViewResolver.