标签的src属性中的请求未处理

时间:2022-06-01 15:15:33

I have a request which contains parameters and response will give barcode image. We are using Comergent frame work.

我有一个包含参数和响应的请求将给出条形码图像。我们正在使用Comergent框架工作。

<img src="../direct/bestbuy?cmd=BBFBGenerateBarCode&type=code128&msg=12345&fmt=JPEG&height=10&hrsize=5pt" alt="Barcode" width="166" height="44">

The above will go the controller "BBFBGenerateBarCode" and execute the corresponding java class "BarCodeGenerator.java" which will create barcode image and return image in response.

以上将进入控制器“BBFBGenerateBarCode”并执行相应的java类“BarCodeGenerator.java”,它将创建条形码图像并返回图像作为响应。

Problem i am facing is, i need to display this image in two things. One is Print page and another in email. If i use the above code in Print.jsp, the request get processed and goes to BarCodeGenerator.java class(i have used system.out.println() in BarCodeGenerator.java) and create image and displaying in printpage But if i use the above image tag in confirmemail.jsp(will send email to user), request is not processing and i cant able to see the image in mail. Please help me.

我面临的问题是,我需要在两件事中显示这个图像。一个是打印页面,另一个是电子邮件。如果我在Print.jsp中使用上面的代码,请求被处理并转到BarCodeGenerator.java类(我在BarCodeGenerator.java中使用了system.out.println())并创建图像并在printpage中显示但是如果我使用在confirmmemail.jsp上面的图片标签(将向用户发送电子邮件),请求没有处理,我无法在邮件中看到图像。请帮我。

1 个解决方案

#1


This may seem like an elementary issue, and I apologize if you have already discovered that this isn't the problem, but if you are using the literal path of ../direct/bestbuy?cmd=BBFBGenerateBarCode&type=code128&msg=12345&fmt=JPEG&height=10&hrsize=5pt in your email, you will never get an image from that, at least from a desktop email client.

这看起来像是一个基本问题,如果您已经发现这不是问题,我会道歉,但如果您使用的文字路径为../direct/bestbuy?cmd=BBFBGenerateBarCode&type=code128&msg=12345&fmt=JPEG&height= 10&hrsize = 5pt在您的电子邮件中,您永远不会从中获取图像,至少从桌面电子邮件客户端获取图像。

What you want to be doing, is prefixing it with the server name/path. Assuming that mydomain.com is the domain name you are using, you will want to update your email content to have the following image tag:

你想要做的是在它前面加上服务器名称/路径。假设mydomain.com是您正在使用的域名,您将需要更新您的电子邮件内容以获得以下图像标记:

<img src="http://mydomain.com/direct/bestbuy?cmd=BBFBGenerateBarCode&type=code128&msg=12345&fmt=JPEG&height=10&hrsize=5pt" alt="Barcode" width="166" height="44">

This also assumes correct pathing to the /direct/bestbuy servlet/jsp/etc.

这也假设正确路径到/ direct / bestbuy servlet / jsp / etc。

#1


This may seem like an elementary issue, and I apologize if you have already discovered that this isn't the problem, but if you are using the literal path of ../direct/bestbuy?cmd=BBFBGenerateBarCode&type=code128&msg=12345&fmt=JPEG&height=10&hrsize=5pt in your email, you will never get an image from that, at least from a desktop email client.

这看起来像是一个基本问题,如果您已经发现这不是问题,我会道歉,但如果您使用的文字路径为../direct/bestbuy?cmd=BBFBGenerateBarCode&type=code128&msg=12345&fmt=JPEG&height= 10&hrsize = 5pt在您的电子邮件中,您永远不会从中获取图像,至少从桌面电子邮件客户端获取图像。

What you want to be doing, is prefixing it with the server name/path. Assuming that mydomain.com is the domain name you are using, you will want to update your email content to have the following image tag:

你想要做的是在它前面加上服务器名称/路径。假设mydomain.com是您正在使用的域名,您将需要更新您的电子邮件内容以获得以下图像标记:

<img src="http://mydomain.com/direct/bestbuy?cmd=BBFBGenerateBarCode&type=code128&msg=12345&fmt=JPEG&height=10&hrsize=5pt" alt="Barcode" width="166" height="44">

This also assumes correct pathing to the /direct/bestbuy servlet/jsp/etc.

这也假设正确路径到/ direct / bestbuy servlet / jsp / etc。