JumboDumbo-8428 avatar image
1 Vote"
JumboDumbo-8428 asked JackJJun-MSFT commented

how to create a Servlet in a c# client

So I am trying to make a Servlet in my c# programm related to my h2 database and I cant figure out how to create a c# Servlet, or Client?

This is my Servlet(implemented in Java):

@WebServlet(name = "helloServlet", value = "/hello-servlet")
public class HelloServlet extends HttpServlet {

 public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

     Employee employee = JSP_Client.getEmployee(request.getParameter("name"));
     request.setAttribute("selectedEmployee", employee);
     RequestDispatcher requestDispatcher = request.getRequestDispatcher("employee.jsp");
 public void destroy() {


And my Client looks like this:

package Controller;

import common.IEmployee;
import common.ILogBookEntry;
import model.Employee;

import java.util.ArrayList;

public class Client {
public static IEmployee employees;
public static ILogBookEntry entries;

 public Client() {

 public static void employeeClient() {
     employees = RestClientBuilder.newBuilder()
 public static void logbookEntryClient() {
     entries = RestClientBuilder.newBuilder()

 public static ArrayList<Employee> getAllEmployees(){
     return (ArrayList<Employee>) employees.getAllEmployees();

 public static Employee getEmployee(String name){
     for (Employee emp:getAllEmployees()) {
             return emp;
     return null;


Can someone help me implement a c# client, as I am quite new to c# and dotNet

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@JumboDumbo-8428, Welcome to Microsoft Q&A, it seems that you want to convert web java app to web c# app, right? If so, which type you want to use in c#, is app or core app? It will be better for me to analyze your problem to determine your project type.

0 Votes 0 ·

0 Answers