Vote count: 0 I have a problem: "When I call index.jsp, it's not call severlet page. (1) index.jsp page: Insert title here (2) servlet/HelloServlet.java class package servlet; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.aotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet("/HelloServlet") public class HelloServlet extends HttpServlet { private static final long serialVersionUID = 1L; public HelloServlet() { super(); // TODO Auto-generated constructor stub } protected void doGet(HttpServletRequest request, HttpServletResponse response) thr...
ادامه مطلبVote count: 0 I have database with EmpNo(Int) and EmpImage(Image) columns. I am using HttpHandler to display the Images. I am storing Images both in database and folder. Now I want to change the names of Images in folder as names of EmpNo whose I didn't change while uploading. So need to fetch the Images names from database to compare them with the Image names in the folder and rename them. How can i fetch or extract the image names from the binary data that i get from database using generic handler. I have attached the code In handler for reference. using System; using System.Web; using System.Data; using System.Data.SqlClient; public class Lab_14___ImageFetchingHandler : IHttpHandler { pub...
ادامه مطلبVote count: 0 I am trying to develop a simple form using angular js 1.* and asp.net mvc 5. When I try to save the form data using $http(), it hits the action but none of the data is passed. But if I use $.post(), it works perfectly. Could anybody please explain me why? Is that because we need to use ApiController instead of normal mvc's Controller? Or what could be the potential problem? AddEmployeeController.js (function () { 'use strict'; angular.module('ApplicationModule').controller('AddEmployeeController', function ($scope, SPACRUDService) { $scope.Id = 0; $scope.employee = { FirstName: 'Hello', MiddleName: '', LastName: '', CurrentAddress: '', PermanentAddress: '', Gender: 'M', MobileP...
ادامه مطلبVote count: -1 I try to use the promise respond from a $http.post, to get back the new ID of the record as integer and use it for the next $http.post. I used How do I retu the response from an asynchronous call? for help but it still don´t work. var streckenId; var trackpunktId; var getStreckeID = function () { $http.post(dbStrecke, {"ort": location, "distanz": km}).then(function (response) { streckenId = response.data; console.log("ID (then): " + streckenId); // retu ID }); retu streckenId; }; streckenId = getStreckeID(); console.log("StreckeID:" + streckenId); //retu undefined The last console.log still say that "streckenId" is undefined. asked 2 mins agoJ4ck Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I am trying to add a button or link somewhere on the webpage that would disable the http-equiv redirect in the document head. If I am honest, I have no idea how to go about doing this. If it helps, I am using Bootstrap 3.3.6 I would appreciate if anyone could help me achieve this, thanks. asked 1 min agouser6405423 Let's block ads! بخوانید...
ادامه مطلبVote count: 0 Using progress openedge 11.6 I am attempting to post to a REST service using a socket coection with an 'expect: 100-continue' header but am unable to get any response results. Can this be done with an openedge socket coection? If so how can the request be configured so that separate header and body readResponses are defined? asked 3 mins agoAdamY Let's block ads! بخوانید...
ادامه مطلبVote count: 0 Code: function f(input) { retu '' + input + ''; } document.write(f('alert(1)')); //alert 1 document.write(f('<script>alert(1)</script>')); // write normal text In my idea, alert(1) is the same as <script>alert(1)</script>(the raw vs http entity codes), but it results different result, could any body explain about that? asked 4 mins agoSayakiss Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I am starting to use Java AIO (better than NIO) in the program that keep monitoring thousands of web sites for port 80 by interval time (seconds), now I have issues that: There are no timeout settings if coection is timeout, just have completed() and failed() method It is still to use many threads for every AIO? I mean every thread for looping by time and use AIO inside? it have better ways to do so? I have tried to use schedulable executors with HTTPURLCoection, Apache HTTP client even Netty, but it seems that the CPU is very high almost 70-80% every time concurrent, Now my server is 4x core Xeon CPUs and 8G memory :(, I also found that the issue not related to memory! Thanks!...
ادامه مطلبVote count: 0 I am trying to get set up with a VCS (Subversion) repository on my inteal network, my hope was to then have that repository mirrored by Satis so that the clients can download their packages quickly. However, I keep getting errors that the security certificate could not be verified. I have disabled verify_peer according to the Composer documentation. What else do I need to do? This is the configuration in my satis.json file for this repository I am trying to configure: { "type": "vcs", "url": "https://svn.company.com:8443/svn/project/", "options": { "ssl": { "verify_peer": false } } } Our inteal network uses rotating SSL certificates that are managed through the Windows Domain, ...
ادامه مطلبVote count: 0 I have a simple https server serving a simple page like so (no error handling for brevity): package main import ( "crypto/tls" "fmt" "net/http" ) func main() { mux := http.NewServeMux() mux.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { fmt.Fprintf(w, "hello!") }) xcert, _ := tls.LoadX509KeyPair("cert1.crt", "key1.pem") tlsConf := &tls.Config{ Certificates: []tls.Certificate{xcert}, } srv := &http.Server{ Addr: ":https", Handler: mux, TLSConfig: tlsConf, } srv.ListenAndServeTLS("", "") } I want to use a Let's Encrypt TLS certificate to serve the content over https. I would like to be able to do certificate renewals and update the certificate in the server with...
ادامه مطلبVote count: 0 I am a newbie to REST API's. I need to post to the website, but I get response code as 400 and content-type as text/plain If I use Advanced REST Client Application of google, I get different results. The response code is 500 and the content-type is text/html. Am I not ending the post data (query1) correctly? Is this the correct way of doing it? Do I need to use JAX-RS? Can someone please help? Appreciate it. import java.io.DataOutputStream; import java.io.InputStream; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.Writer; import java.net.HttpURLCoection; import java.net.URL; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; im...
ادامه مطلبVote count: 0 I am trying to load images from my server, but when image is loading I am getting: javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found. Are there any configurations to set trust certificate for Glide or other settings to avoid this error? asked 42 secs agoGuntars Ļuta Let's block ads! بخوانید...
ادامه مطلبVote count: 0 This might be an odd question, but I'm ultimately trying to click an "add to cart" button by sending a POST request in C#. I'm currently using Advanced REST Client to try to send the request and I'm having a lot trouble. This is the item I'm trying to add to cart. I am sending the POST request with http://www.supremenewyork.com/shop/169720/add?authenticity_token=oZ2ZwxDZwEJ%2BUSczNZrhUlNSGw5NnsP%2FvcbxiSnxnSM%3D&commit=add%20to%20cart&size=32377&utf8=%E2%9C%93 but I keep getting 404 not found. I might be putting in the wrong information into the client. I just started leaing about POST/GET requests yesterday, so any advice would be greatly appreciated; thank you. asked 54 secs ...
ادامه مطلبVote count: 0 i can send data to mysql table and it is working good. now i want to get that data. i tried this code but it doesn't show any data from mysql table. can anyone help? maybe there is a different way? thank you PHP code: Controller: "use strict"; var app = angular.module('dataSystem',[]); app.controller('customerCardsCtrl',function($scope,$route,$location,$http){ $http({method:'GET', url:'api/get-allCustomers.php'}) .then(function(response) { $scope.customers = response.data; }) // This will log you the error code and trace, if there is an error. .catch(function(err) { console.log(err) }); }); }); html code: ufeff כאן יהיו רשימת כרטיסי לקוחות {{ x.customer_id}} {{ x.first_name }} ...
ادامه مطلبVote count: 0 I have several domains with and different tracking Ids - each domain has it's own tracking ID. I'm using following directive to insert correct ID: app.directive('analytics', ['$compile', function($compile) { retu { restrict: 'A', scope: { id: '=analytics' }, link: function (scope) { var el = $("#analytics"); var text = "(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); "; scope.$watch('id', function (trackId) { if (trackId...
ادامه مطلبVote count: 0 Currently using a test developer account for Sabre Dev Studio and trying to use their REST Api - Instaflights_Search. I'm creating the authentication and getting an access token fine but the problem arises when I try to send a request. I'm creating the headers using curl and php. function callRestApi($url,$access_token) { $ch = curl_init(); $header = array(); $header[] = "Authorization: Bearer " .$access_token; $header[] = "Accept: application/json"; $header[] = 'Content-Type: application/json'; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_HTTPGET, 1); curl_setopt($ch, CURLOPT_VERBOSE, true); curl_setopt($ch, CURLO...
ادامه مطلبVote count: 0 I am trying to write a lambda script that can pull an image from a site and store it in S3. The problem I'm having is what kind of object to pass as the Body attribute into the S3.putObject method. In the documentation here it says it should be either new Buffer('...') || 'STRING_VALUE' || streamObject, but I'm not sure how to convert the https response into one of those. Here is what I've tried: var AWS = require('aws-sdk'); var https = require('https'); var Readable = require('stream').Readable; var s3 = new AWS.S3(); var fs = require('fs'); var url = 'https://upload.wikimedia.org/wikipedia/commons/thumb/1/1d/AmazonWebservices_Logo.svg/500px-AmazonWebservices_Logo.svg.png' ex...
ادامه مطلبVote count: 0 I am a new to ASP.NET MVC, I had been working on ASP.NET Webform. I have couple of questions with respect to design in ASP.NET MVC. [Note I am working on ASP.NET MVC3 Razor View Engine]. SCENARIO I am creating a search panel. So When the search is submit, it search for different information. Example: An account search. So in search I am providing information and the search would result, Account details (different panel), Account Balance (different panel), all activities belongs to that account (seperate panel) How should I display the three panels after the search is submitted? Displaying activities search result would have the feature to edit each item as well. So should I kee...
ادامه مطلبVote count: 0 I would like to set up a wiki for the project using the template of https://developer.github.com/v3/. Please advise how to proceed and I would very much appreciate. asked 2 mins agouser12586 Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I have a c# project with a RESTfull client and RESTfull server. I am unable to get PUT request to work. I think I am maybe not using PutAsJsonAsync() correctly. The client... using System.Net.Http; using System.Net.Http.Formatting; public class RequestParams { public String param1 { get; set;} } fullUrl = "http://localhost:3578/api/v1.0/config"; client = new HttpClient(); var requestParams = new RequestParams { parm1 = "value1" }; response = client.PutAsJsonAsync(fullUrl, requestParams).Result; var result = response.Content.ReadAsStringAsync().Result; The server (nancy self hosting)... Put["/api/v1.0/config"] = x => { NameValueCollection requestParams = HttpUtility.ParseQuerySt...
ادامه مطلب