the request resource is not available

form表单递交数据的问题

我的解决方法

将要访问的servlet地址写入form的action中

例如:访问地址为http://localhost:8080/Webprojectselfservice/SignUp

就将此地址写入action中,、或者写/Webprojectselfservice/SignUp

<form action="/Webprojectselfservice/SignUp" method="post" name="form">

 

转载于:https://www.cnblogs.com/l1019/p/5875014.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
CORS stands for Cross-Origin Resource Sharing, and it is a security mechanism implemented by web browsers to protect users from malicious scripts. When a web page makes a request to a different domain, the browser checks if the server includes the 'Access-Control-Allow-Origin' header in its response. If the header is not present or does not match the origin of the requesting page, the browser blocks the request. The error message you mentioned, "has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource," indicates that the server you are making a request to does not allow cross-origin requests from your domain. This can happen if the server is not configured properly or intentionally restricts access. To fix this issue, you have a few options: 1. Modify the server's response headers: If you have control over the server, you can add the 'Access-Control-Allow-Origin' header to the response. This header should include the domain from which you are making the request or use "*" to allow requests from any domain. Here is an example of how to set this header in a server response: ``` Access-Control-Allow-Origin: https://your-domain.com ``` 2. Use a proxy server: If you do not have control over the server's configuration or cannot modify it, you can set up a proxy server that acts as an intermediary between your web page and the target server. The proxy server can make the request on behalf of your page, and since the request will be from the same origin as your page, it will not be blocked by CORS restrictions. 3. Utilize JSONP or CORS workaround techniques: JSONP (JSON with Padding) is an older technique that allows cross-origin requests by loading scripts instead of making XMLHttpRequests. However, it has some limitations and potential security risks. Alternatively, some servers may provide specific workarounds or APIs that bypass CORS restrictions. You can check the server's documentation or contact the server owner to see if there are any alternative methods available for making cross-origin requests. Remember, the specific solution will depend on your server's configuration and the requirements of your application.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值