首页 \ 问答 \ Eclipse的WTP转换输出(Eclipse's WTP translation output)

Eclipse的WTP转换输出(Eclipse's WTP translation output)

如何查看WTP对JSP和JSPX页面进行的中间转换? 在具有大量.jspx页面的项目中,我在Eclipse的Problems选项卡中遇到了奇怪的语法错误。 它们不会影响正在运行的应用程序(Tomcat 6.0)中的任何内容,并且它们仅在更新后的最后2周内出现。

我想查看输出的原因是我在http://stripesframework.org上使用Stripes框架,并且在删除<stripes:errors />行之后,特定.jspx文件的错误消失了。那个文件。 与此同时,语法错误只出现在我最近在工作中完成Eclipse的全新安装之后,但随后在家中更新了Eclipse。 我想看看输出,以确定这应该是谁的问题(WTP,条纹,或者可能只是我:)。

请记住,这个问题有些美观,因为它不会影响任何功能。 它只是在Eclipse中发送我的Problems选项卡,并在项目浏览器中显示小红色X图标。


How can I view the intermediate translation done to JSP and JSPX pages by WTP? I'm getting weird syntax errors in my Problems tab of Eclipse in a project that has plenty of .jspx pages. They don't affect anything in the running application (Tomcat 6.0) and they appeared only over the last 2 weeks, after an update.

The reason why I'd like to view the output is that I'm using the Stripes framework at http://stripesframework.org and the errors disappear for a particular .jspx file after I remove the <stripes:errors /> line of that file. At the same time, the syntax errors only appeared after I did recent fresh install of Eclipse at work, but then an update of Eclipse at home shortly therafter. I'd like to see the output to determine whose problem this should be (WTP, Stripes, or maybe just me :).

Remember that this issue is somewhat cosmetic, as it doesn't affect anything functionally. It simply spams my Problems tab in Eclipse and shows the little red X icons in the project explorer.


原文:https://stackoverflow.com/questions/169435
更新时间:2021-11-23 15:11

最满意答案

我可以发现,如果在ToolWindowsPane.paintChildren()的上下文中调用graphstream ViewPanel的paintComponent() ,则只会删除绘图。 在大多数情况下,不同地调用paintComponent() (堆栈上的方法更少,特别是ToolWindowsPane没有任何方法)。

例如,每次在IntelliJ中的某个位置显示工具提示时,似乎都会调用ToolWindowsPane.paintChildren() 。 因此,绕过问题的一个肮脏的黑客是使用重写的paintComponent实现自定义ViewPanel 。 这很容易,因为graphstream的DefaultView可以扩展。

以下代码查看调用层次结构,并在必要时发出repaint() 。 这解决了这个问题,但会导致额外的渲染工作,但在我的情况下这似乎不是问题。

public class CustomView extends DefaultView { 

  public CustomView(Viewer viewer, String identifier, GraphRenderer graphRenderer) { 
    super(viewer, identifier, graphRenderer); 
  } 

  @Override 
  public void paintComponent(Graphics g) {  
    StackTraceElement[] stackElements = Thread.currentThread().getStackTrace(); 
    for (int i = 0; i < stackElements.length; i++) { 
      if (stackElements[i].getClassName().equals(ToolWindowsPane.class.getName())) { 
        repaint(); 
        break; 
      } 
    } 
    super.paintComponent(g); 
  } 

}

I could find out that erasing the drawing only occurs, if paintComponent() of the graphstream ViewPanel is called in the context of ToolWindowsPane.paintChildren(). In most cases paintComponent() is called differently (fewer methods on the stack, especially nothing from ToolWindowsPane).

ToolWindowsPane.paintChildren() seems to be called every time a tooltip is displayed somewhere in IntelliJ, for example. So a dirty hack to circumvent the problem was to implement a custom ViewPanel with overridden paintComponent. This was easy because DefaultView of graphstream can be extended.

The following code looks into the call hierarchy and issues a repaint() if necessary. This solved the problem, but causes extra rendering effort, which however does not seem to be a problem in my case.

public class CustomView extends DefaultView { 

  public CustomView(Viewer viewer, String identifier, GraphRenderer graphRenderer) { 
    super(viewer, identifier, graphRenderer); 
  } 

  @Override 
  public void paintComponent(Graphics g) {  
    StackTraceElement[] stackElements = Thread.currentThread().getStackTrace(); 
    for (int i = 0; i < stackElements.length; i++) { 
      if (stackElements[i].getClassName().equals(ToolWindowsPane.class.getName())) { 
        repaint(); 
        break; 
      } 
    } 
    super.paintComponent(g); 
  } 

}

相关问答

更多
  • 在您描述的情况下,当您只需要自上而下的流程时,您可以简单地使用Panel而不是FlowLayoutPanel。 将面板AutoScroll设置为true,将Dock为Fill ,然后将组框添加到面板并将它们的Dock属性设置为Top 。 注意: 对于FlowLayoutPanel未来使用,您可能会发现这有用: 如何:在FlowLayoutPanel控件中锚定和停靠子控件 这是FlowLayoutPanel控件中锚定和停靠的一般规则: 对于垂直流方向,FlowLayoutPanel控件计算列中最宽子控件的隐含 ...
  • 首先,更新到9.0.3版本,它是免费的。 然后使用调试器面板左侧的恢复布局按钮。 I discovered I could get it back by clicking on a certain spot in the far right of the "Debug" panel toolbar. It looks like 9.0.1 has a blank icon for the "Output" sub-panel, so you just have to guess where the blan ...
  • 大多数症状表明您尝试ajax渲染视图中不存在的组件。 因此,您得到错误,因为JSF无法知道要更新的内容:当ajax调用完成时,具有指定ID的组件将使用从服务器派生的新组件替换它们。 所以,这不起作用: 虽然这将按预期工作: ...
  • Aaaand我修好了。 解决方案:将字节码和编译器版本设置为相同的版本。 调整大小问题的解决方案 - 设置水平和垂直对齐以填充。 还必须在createUIComponents()中创建该类的对象 Aaaand I fixed it. Solution: set bytecode and compiler versions to the same one. Solution for the resize problem - set horizontal and vertical aligns to fill. ...
  • 您可以将工具栏直接添加到JFrame的JLayeredPane 。 这是一些有用的文档: 如何使用分层窗格 public static void main(final String args[]) { JFrame frame = new JFrame("JToolBar Example"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JToolBar toolbar = new JToolBar(); t ...
  • 您还需要为第二个面板指定height 。 You need to specify height for your second panel as well.
  • 我可以发现,如果在ToolWindowsPane.paintChildren()的上下文中调用graphstream ViewPanel的paintComponent() ,则只会删除绘图。 在大多数情况下,不同地调用paintComponent() (堆栈上的方法更少,特别是ToolWindowsPane没有任何方法)。 例如,每次在IntelliJ中的某个位置显示工具提示时,似乎都会调用ToolWindowsPane.paintChildren() 。 因此,绕过问题的一个肮脏的黑客是使用重写的pain ...
  • 你应该仔细搜索:)这听起来像https://code.google.com/p/chromium/issues/detail?id=225705 ,这是在一周前修复的(现在修复应该在Canary) 。 You should search more carefully :) This sounds like https://code.google.com/p/chromium/issues/detail?id=225705, which was fixed around a week ago (and the ...
  • 找到解决方案, view->enter presentation mode然后view->exit presentation mode转到实际大小窗口 Found the solution , view->enter presentation mode then view->exit presentation mode to go to real size window
  • Web控制台不是侧边栏 。 在Fireox中只有一个侧边栏,它可以位于浏览器内容的左侧或右侧。 即使您更改了标签,侧边栏也是UI的常量部分。 它通常用于内容,历史记录,书签或其他此类信息,这些信息根据您正在查看的选项卡不会更改。 为了调查这样的东西,如果你还没有安装它,我会建议DOM Inspector插件。 Web控制台包含在中的