question

CodeDribbler-9143 avatar image
0 Votes"
CodeDribbler-9143 asked CodeDribbler-9143 edited

Is it possible to connect a java project with a c# project?

I have a java project and a c# project witch I would like to connect.
My java project contains Servlets and a REST-Service and my c# project contains a WCF-Client and a WPF-Application.
Is there any way how I can do this?
204622-csharp.txt204593-classes.txt

absences.jsp
//////////////////////////////////////////////////
<%@ page import="java.util.Set" %>
<%@ page import="model.Absence" %><%--
Created by IntelliJ IDEA.
User: kersc
Date: 5/21/2022
Time: 7:46 PM
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Absences</title>
</head>
<body>
<h1>Absences</h1>
<table>
<tr>
<th>ID</th>
<th>From</th>
<th>To</th>
<th>Reason</th>
<th>Excused</th>
</tr>

 <%
     Set<Absence> absences = (Set<Absence>) request.getAttribute("absences");

     for(Absence absence : absences) {
         out.println("<tr><td>" + absence.getId() + "</td><td>" + absence.getFrom() +
             "</td><td>" + absence.getTo() + "</td><td>" + absence.getReason() +
             "</td><td>" + absence.getExcused() + "</td></tr>");
     }
 %>

</table>
</body>
</html>
//////////////////////////////////////////////////
index.jsp
//////////////////////////////////////////////////
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
<title>Absences</title>
</head>
<body>
<h1><%= "Absences" %>
</h1>
<br/>
<a href="PupilsServlet">Pupils</a>
</body>
</html>
//////////////////////////////////////////////////
pupils.jsp
//////////////////////////////////////////////////
<%@ page import="model.Pupil" %>
<%@ page import="java.util.Set" %><%--
Created by IntelliJ IDEA.
User: kersc
Date: 5/21/2022
Time: 7:54 PM
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Pupils</title>
</head>
<body>
<h1>Pupils</h1>
<form action="AbsencesServlet" method="post">
<label for="pupils"></label>
<select name="pupils" id="pupils">
<%
Set<Pupil> pupils = (Set<Pupil>) request.getAttribute("pupils");

         for (Pupil p : pupils) {
             out.print("<option value=\"" + p.getId() + "\">" + p.getFirstName() +
                 " " + p.getLastName() + "</option>");
         }
     %>
 </select>
 <input type="submit" value="show absences">

</form>
</body>
</html>




dotnet-wpf-xamlwindows-wcf
classes.txt (8.9 KiB)
csharp.txt (2.7 KiB)
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.

0 Answers