HTTP request with scriptlet in JSP

608 Views Asked by At

I'am making a website that communicate with a web server. and in the servlet I'am using http request to send queries and store it in my session. i need values that will be coming from the web server and i dont want to put it to my session. Is it ok to communicate with the web server using scriptlet?

<%
Gson gson=new Gson();
//send query to web server
 Httprequest request=new Httprequest("query");
Object[] obj=gson.fromJson(request,obj[].class);
%>


<select>
<%
for(int i=0;i<obj.length;i++){
out.println("<option>"+obj[i]+"</option>");
}
%>
</select>
0

There are 0 best solutions below