在Eclipse中编辑xhtml jsp文件 [英] Editing xhtml jsp files in Eclipse

查看:108
本文介绍了在Eclipse中编辑xhtml jsp文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些应该输出xhtml的jsp文件。他们似乎有正确的doctype等,但Eclipse没有解析xhtml属性。例如对于根元素:

I've got some jsp files that are supposed to output xhtml. They seem to have the correct doctype etc but Eclipse is not parsing the xhtml attributes. For instance for the root element:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

我收到警告:未定义的属性名称(xmlns)。在Eclipse中解决这个问题的最佳方法是什么?

I get the warning: "Undefined attribute name (xmlns)." What's the best way to solve this in Eclipse?

编辑:这个特定文件的doctype显然是错误的,它被设置为:

edit: The doctype for this particular file was wrong apparently, it was set to:

<!DOCTYPE html PUBLIC 
   "-//W3C//DTD XHTML 1.1 Transitional//EN" 
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

显然不存在。 Eclipse现在抱怨taglib标签,即:

Which does not exist obviously. Eclipse is now complaining about taglib tags though, i.e.:

<%@taglib prefix="s" uri="/struts-tags" %>

生成警告:Tag(jsp:directive.taglib)应该是一个空元素标记。

generates the warning: "Tag (jsp:directive.taglib) should be an empty-element tag."

推荐答案

这看起来很奇怪,我在Eclipse中使用相同但使用PHP并且它工作正常。

That seems odd, I use the same in Eclipse but with PHP and it works fine.

您使用的DOCTYPE是什么?我用过

What is the DOCTYPE that you use? I've used

<!DOCTYPE html PUBLIC - // W3C // DTD XHTML 1.0 Strict // ENhttp:/ /www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">

这篇关于在Eclipse中编辑xhtml jsp文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆