G
Giox
Hello everybody,
I would like to use a working servlet that generates png images as
source for a <img> tag.
When I access the servlet page generating the png image I can see the
correct image.
The address that I access is
https://localhost:8443/esempio_portale/graphPage
where /graphPage is servlet name mapped in web.xml file.
When trying to use such a servlet as src element of a img tag in a jsp
file, I have to use the following syntax:
<img src="https://localhost:8443/esempio_portale/graphPage"
alt="Impossibile visualizzare l'immagine" />
How can I avoid the full specification of the servlet path? I tried to
write
<img src="/graphPage" alt="Impossibile visualizzare l'immagine" />
with web.xml as follows:
<servlet>
<servlet-name>graphPage</servlet-name>
<servlet-class>com.biz.graph.graphPage</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>graphPage</servlet-name>
<url-pattern>/graphPage</url-pattern>
</servlet-mapping>
but it doesn't work. How can I obtain the desired result?
I'm using Tomcat 5.5
Giovanni
I would like to use a working servlet that generates png images as
source for a <img> tag.
When I access the servlet page generating the png image I can see the
correct image.
The address that I access is
https://localhost:8443/esempio_portale/graphPage
where /graphPage is servlet name mapped in web.xml file.
When trying to use such a servlet as src element of a img tag in a jsp
file, I have to use the following syntax:
<img src="https://localhost:8443/esempio_portale/graphPage"
alt="Impossibile visualizzare l'immagine" />
How can I avoid the full specification of the servlet path? I tried to
write
<img src="/graphPage" alt="Impossibile visualizzare l'immagine" />
with web.xml as follows:
<servlet>
<servlet-name>graphPage</servlet-name>
<servlet-class>com.biz.graph.graphPage</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>graphPage</servlet-name>
<url-pattern>/graphPage</url-pattern>
</servlet-mapping>
but it doesn't work. How can I obtain the desired result?
I'm using Tomcat 5.5
Giovanni