spring mvc - Java web applcation - accessing war files from code -
i using spring mvc develop simple rest interface 1 service.
as 1 of methods return xml representation of object decided use jaxb map classes xml files.
i annotated classes found out in order validation need deliver schema marshaller object.
because using maven bulding added jaxb plugin pom.xml. can see schema files being generated during build phase have problem reading @ runtime.
because planning have 1 controller in application wanted load schema file when controller being created spring framework.
i tried using context.getresourceasstream("schema.xsd"); no luck, getting null return value.
my schema files being deployed to
<outputdirectory>${project.build.directory}/open311/web-inf/classes</outputdirectory> does spring framework provide alternative way of reading static files @ startup can access them in way code?
also want note amdeploying tomcat eclipse-level server view, maybe important.
see question:
spring 3.0 inject files resources
and one:
inject file resource spring bean
which describes how inject resource.
if doesn't work, open navigator view of eclpse , make sure xsd files in classes directory. if not, may need clean build.
Comments
Post a Comment