我正在学习 Java Servlets 和 JSP。
我有以下代码:
HelloServlet.jsp
public class HelloServlet extends HttpServlet {
private static final long serialVersionUID=1;
protected void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
response.setCharacterEncoding("utf-8);
RequestDispatcher aDispatcher = request.getRequestDispatcher("file.jsp");
aDispatcher.forward(request,response);
}
}
Run Code Online (Sandbox Code Playgroud)
file.jsp
<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<title>First JSP</title>
</head>
<body>
Hello!!
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我的web.xml
看起来像这样:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xmlns:schemaLocation="http://java.sun.som/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>Hello</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<servlet>
<description></description> …
Run Code Online (Sandbox Code Playgroud) 我收到以下错误:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 220 bytes)
我正php 5.4
和我一起工作sql Anywhere 11
.
对此的解决方案是根据这是放入ini_set('memory_set',-1);
我的php-file
,但在这之后我得到另一个错误:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 3 bytes)
编辑:我的代码是
<?php
ini_set('memory_set',-1);
$connect = sasql_connect("UID=username;PWD=pass");
echo "Connection succeed";
$result = sasql_query($connect, "SELECT * FROM table1, table2");
if(!$result){
echo "sasql_query failed";
return 0;
} else {
echo "query …
Run Code Online (Sandbox Code Playgroud)